//2017-6-26
//09.03.13 加了链接到定制的访客信息收集页的支持_tq_collect_page_type
//09.09.01 加自动邀请等，
//2009-9-28修正在IE下，网页中有长连接时，TQ不加载的问题,但解决后有可能会导致某些网站出现“连接已经关闭，该站点无法打开”的问题。（如果这个http://www.lipao.cn/网站不出现此问题，就没事）
//2009-9-30将tq_visit_title的长度限制为22个字符以内,将reffer_url和location_url的长度限制为100个字符内
//2009-10-10防恶意点击不生效的问题，修改reffer_url的取法
//2009-10-14加载float.js和invite.js时，加了defer属性,但也很危险,因为若网页中有打不开的iframe,则有defer属性的JS就永远不会执行
//2009-10-15有问题的网站，弹不出飘浮框，是因为对方网站中有打不开的ifame,首先要让对方去掉打不开的iframe,
//若去不掉就在嵌入代码前加一句<script>var tqUserDefined = {forceLoadRequiredJS:10}//单位秒</script>，但有可能导致“internet explorer 无法打开站点，已终止操作”
//下一步，后台中要加上加载JS方式的设置分为document.write和creatElement两种
//网站有漂浮框出不来的情况，就加var tqUserDefined = {forceLoadRequiredJS:10}，若这样加了后出现“internet explorer 无法打开站点，已终止操作”，就加var tqUserDefined = {forceLoadRequiredJS:10,defer:true},若还是不行，就改用document.write方式
//修正TQKF.reffer_url= //top.document.referrer;会与中搜客户代码冲突的问题
//2009-10-19修正关键词乱码的问题
//2009-10-20修正关键词在firefox下乱码的问题   firefox和百度一样是将url中的汉字用java的encodeURL方法编码的，IE对汉字不编码,google对关键词是用UTF8编码,firefox中写cookie时,写汉字会读出乱码
//2009-10-25增加了仿百度留言的迷你留言的功能
//2009-10-27antibadclick.js改为用document.write方式加载，以解决有的网站打开速度慢,防恶意不生效的问题
/*2009-11-6加了传clientname参数的支持，对方若需要传此参数，则在其嵌入代码前加一个变量var tq_clientname = "名字";　即可  ,
*clientid也可以表示对方的产品代码
*增加了五个扩展参数的支持，在嵌入代码中的命名为tq_para1,tq_para2,tq_para3,tq_para4,tq_para5
*/
/*2009-11-24加了是否支持fixed定位的判断*/
//2009-12-8tq_clientname若存在，则将其用UTF-8编码后再将%替换为^
/*2009-12-10
解决mantis0009459号问题http://www.bj-tofi.com　用loadCSS时，网站内的滚动广告会变形。
所以在userDefined中加了一个字段loadCSSType,可选值为auto,当为manual时TQ的JS不再自动加载CSS，而是需要对方手动将需要的css加在<head>中

除加载CSS方式原因外，还定位到一个原因，就是当询问框有锁定页面的层时，指定此层的定位方式和高度、宽度，就会导致变形，否则不变。而这个操作与网页没有任何关系，也是IE莫名的bug。
避免此问题的方法。除用上面所说的CSS问题解决办法外，还需要对方在设置代码时注意，
在访客接待的设置中，“是否使用锁定页面功能”这项要选“否”

解决方法为：
1、让他们在<head></head>标签中，根据代码设置的需要，将相应的CSS的引用加入，如下：
飘浮框用的CSS
<link rel="stylesheet" type="text/css" href="http://sysimages.tq.cn/images/vip/tracqfloat.css"/> [^]

中间形式有“稍后再说”按钮的询问框用到的CSS　风格2
<link rel="stylesheet" type="text/css" href="http://sysimages.tq.cn/images/vip/tq_invit_s1_t1.css"/> [^]

中间形式没“稍后再说”按钮的询问框用到的CSS 风格1
<link rel="stylesheet" type="text/css" href="http://sysimages.tq.cn/images/vip/tq_invit_s1_t2.css"/> [^]

右下角形式询问框用到的CSS
<link rel="stylesheet" type="text/css" href="http://sysimages.tq.cn/images/vip/tq_invit_s2_t1.css"/> [^]


2、在我们的VIP嵌入代码前加多如下一句代码：
<script>
var tqUserDefined = {loadCSSType:"manual"};
</script>

*/
//2009-12-13加了tq_is_minimess字段，则自动开通迷你留言功能
//2009-12-14修正统计代码对我们的影响，因为统计代码中有一句var location="";这样就导致我们取location.href时出错，改为用window.location.href
//2009-12-17修正策略组飘浮框中同时有中文和其它文时，宽度不正常的问题。解决方法为在嵌入代码前加一句,如：var tqUserDefined = {tacticFloaterWidth:"120px"};//120px为自己想要设定的宽度值，可更改
//2009-12-18多加了搜狗、搜搜、中搜的防恶意点击的搜索引擎配置
//2009-12-21修正http://www.samchina.com的莫名问题,用insertBefore方式生成DOM时，会使网页中的第一个DIV的margin属性失效，而导致变形，而用appendChild则没事，但用appendChild时，必须要将代码放在网页最后。解决方法为在嵌入代码前加一句,如：var tqUserDefined = {appendDOMType:"appendChild"};
//2009-12-22打开无控件需要获得来访次数，以传给客户端显示。参数名同发给访客接待的来访参数名一样comTimes
//2010-1-27客服图标形式加最小化按钮的可定制支持，包括：最小化按钮的尺寸，最小化按钮距左边的距离，最小化后的图片（包括在线的离线）
//2010-2-6改为VIP默认不开通，免费用户默认开通
/**
2010-1-9改免费版的和VIP版的兼容
Displaytype 询问框的风格，即有无稍后再说按钮 //免费版原意： 1 显示登陆名 2 显示编号 3 输入的漂浮框名(默认值)
language_type 免费版原意网页语言类型，现为策略组形式策略号的集合，用“|”分隔的
免费版的要限制不能用迷你会话功能。
免费版接通的留言页面和会话页面不一样。
免费版的询问框和VIP不一样，可通过增加样式的方法，用style=0表示免费版的
*/
//2010-3-8 改tq_useraccount的含义为：　是否有访客接待功能 0:无　1：有　2：仅用统计功能

/*2010-3-18 
ver2.4.0 
	修正了“仅在客服离线时启用”不生效的问题，
	增加了单独迷你留言形式的支持
	修改单独迷你留言生成DOM的方式为appendDOM方式
	在VIP版中不再引用minimess.js文件，直接用minimess_core.js
	增加了image_url做为所有的CSS和图片的总路径，迷你留言中不再设有css路径
*/
/**
ver3.0
配合TQ7.0，全新改版JS

*/

//2010-6-9修正，Array.prototype.push被一些低级的JS或库修改的问题
//2010-6-9isSupportFixedPos的判断有问题，导致在ie7下，右下角询问框不飘浮
//2010-6-22修正CopyValue函数不能拷贝值为0的元素的问题
//2010-7-6统一在线状态
/*2010-7-6
	IE对网页中引入CSS样式表的限制
	◆ 文档中只有前31个link或style标记关联的CSS能够应用。 
　　从第32个开始，其标记关联的CSS都将失效
　　◆ 一个style标记只有前31次@import指令有效应用。 
　　从第32个@import指令开始忽略。 
　　◆ 一个css文件只有前31次@import指令有效应用。 
　　从第31个@import指令开始忽略。 
　　◆ 一个CSS文件的不能超过288kb 
*/
/*2010-7-7
加定制的需求　点击业务咨询的时候可以只弹出会话窗口，业务咨询的坐席人员是用一个策略组。当点击投资咨询，理财产品咨询，投诉建议这个三个时，出现提示：“此服务只为会员提供，请登录”后调用他们一个页面，
方法为在嵌入代码前加如下代码：
 <SCRIPT LANGUAGE="JavaScript">
 <!--
	//=========请在未登录用户的页面中多加如下代码===============//

	var loginURL = "http://www.tq.cn";//登录页面

	//kefuClickEvent的值为数组，分别依次对应飘浮框中设置的客服或策略组，所以数组长度要与客服数一致！null表示执行默认事件,即打开会话窗口
	var tqUserDefined={kefuClickEvent:"null,tqNotLoginWarning"};
	
	function tqNotLoginWarning()
	{
		if (confirm("此服务只为会员提供，请先登录，现在登录吗？"))
		{
			window.location = loginURL;
			//如果是需要在新窗口中打开，则用下面一句
			//window.open(loginURL);
		}
	}
 //-->
 </SCRIPT>

*/

//2010-8-2 userDefined.inviteInitDelay:500,//为了解决在IE6下，有的网站加载太慢，而导致当生成DOM后太快的appendDOM时，会导致IE死掉的问题
//2010-10-1飘浮框距右时，在chrome下定位不准的问题
//2010-10-1将not_reshow_time由10改为3，0016596号工单
//2010-10-14修正单独免费电话和VIP代码同时使用时，引用两次webcall.js的问题
//2010-11-11修改打开会话页面的默认大小为720*480
//2010-11-18加tq_siteid参数，联盟需求
//2010-12-15飘浮框距右时，在非IE下定位不准的问题
//2010-12-28TQUtils.isSupportFixedPos表示法在firefox下不正确的问题
//2010-12-28统一了rand和clientid，rand表示js生成的访客ID，cleintid表示第三方ID
//2011-1-14修正了在document.compatMode="BackCompat"时，GetWinSize.h不正确的问题
/*2011-1-17代理商定制需求，嵌入代码中由飘浮框服务器读agent_info_tb,多生成如下变量
var tq_agentid = "888";
var tq_software_name = "就医通";
var tq_chat_url	= "http://webchat.jiuyitong.com";
var tq_admin_url = "http://admin.jiuyitong.com";
var tq_card_url = "http://www.jiuyitong.com/card.html";
var tq_chat_logo = "http://www.jiuyitong.com/logo.gif";
*/

//2011-2-21加page_templete_id
//2011-2-24加是否是代理定制的判断，加传isAgent参数给会话页面
//2011-4-28加传logoLink参数(com_info表中的)
//2011-5-9加firebug-lite功能
//2011-5-23加定时更新人员在线状态功能
//2011-6-2修正当仅用于流量统计时，会出现tq_invit_style="",而导致加载的css不存在的问题
//2011-6-3加飘浮框isfloat以后台设置为准
//2011-6-3是否定时更新在线状态的功能放开
//2011-6-10加自定义JS支持,用法，在嵌入代码前加如下代码：
/*
<script>
var tqUserDefined=
	{
		floatJS:"none",//表示不加载float.js，而是用自己在网页中写的其它代码
	}

var tqUserDefined=
	{
		inviteJS:"http://www.abc.com/invite.js",//表示要加载自定义的特定的js,
	}
</script>
*/
//2011-6-26加飘浮框成员高度自定义功能
/*
<script>
var tqUserDefined=
	{
		float_member_h:"60px"
	}
</script>
*/
//2011-7-5将右下角的询问框默认标题改为短点的 "网站管理员请求和您通话"
//2011-7-16关闭是否定时更新在线状态的功能
//2011-8-7若要留言页全屏打开，则在嵌入代码前加 var tq_isFullScreenLeavmsg=1;
//2011-8-17关键词乱码问题

//2011-9-3sogo搜索关键词、看不到关键词的问题,重新修改判断及取关键词的逻辑
//2011-10-24免费版也可以去掉免费电话
//2011-11-15修正在IE7以上版本中，TQUtils。LoadJSAndAutoRemoveSelf不正确而导致的不发心跳包的问题
//2011-11-15开放定时更新在线状态功能
//2011-11-16增加飘浮框简洁模式的离开状态，其它形式要加，需要先做好离开的状态图标
//2011-11-24增加电话忙状态28
/*
STATUS_USERDEFINE = 20, //用户自定义状态
STATUS_OFFLINE = 21, //离线
STATUS_ONLINE = 22, //在线
STATUS_HIDE  = 23, //隐身
STATUS_WORK =2 4, //繁忙（电话 和 会话 都忙）
STATUS_EATING =2 5, //吃
STATUS_LEAVE = 26, //离开
STATUS_ROBOT = 27, //机器人
STATUS_PHONE_BUSY = 28, //电话忙（替换原来的 STATUS_SEND_SMS）
STATUS_SEND_MAIL = 29, //应该没用
STATUS_SESSION_BUSY = 33, //会话忙（原名 STATUS_REFUSE_NEWWEBMSG）STATUS_UNKNOWN,
“在线”：22|28           ----点击允许接进会话
“繁忙”：24|33           ----点击转到留言页面
“离开”：26|25|23        ----点击转到留言页面
“离线”：其他值均为离线。----点击转到留言页面

*/
//2011-12-13因开放会话页面设置的部分功能给免费用户，免费版的留言页也切换到vip版的留言，免费留言和vip留言改为用一套了（和孙总电话沟通）。
//2011-12-29修正上一个工单0024761中，免费用户开放会话页面设置部分功能后，若设置了新的风格，则留言还是旧的，没切换过来的问题
//2011-12-30将在线状态改为数组后，询问框和客服图标形式的在线判断不对的问题
//2012-1-7 漂浮框上TQ客服系统的链接地址需要改一下把http://qtt.tq.cn/show/default.html?floatwin_vip100501_adminid9310559改成：http://www.tq.cn/tqcall.jsp?m=tqpf_管理员号
//2012-2-10加询问框弹出方式细化设置项
//2012-2-27用js来控制同一用户只能打开一个会话窗口
//2012-3-13将飘浮框上的客服系统连接地址改为http://weibo.com/tqcn
//2012-4-11修正因Prototype.js入侵对象原型，使得对象转json时多出一个extend属性而导致访客信息写cookie不正常的问题
//2012-4-16加留言是否发短信的设置
//2012-4-18修正siteid参数与第三方网站冲突的问题
//2012-4-27将飘浮框上的客服系统连接地址改为http://www.jingling.com
//2012-5-5SetCookie2的domain参数不自己去获取了
//2012-5-23排队改c
//2012-5-30留言不走pageinfo.jsp就无法实现自定义留言页url的功能！！
//2012-6-27加webchaturl散列的支持
//2012-7-26中企动力需求，要从嵌入代码中自定义留言页面，方法为在嵌入代码前加入如下代码 <script>var tq_leavemsg_url = "http://www.baidu.com";</script>
//2012-7-26修正tq_chat_url变量存在且为空时，打不开的问题
//2012-7-27将飘浮框上的客服系统连接地址由http://www.jingling.com改为http://weibo.com/tqcn
//2012-9-17加传请求来源及请求内容参数
//2012-11-25传给pageinfo.jsp的page_ulr中有^的问题
//2012-12-6加以超链接形式打开会话页的支持,方法为在嵌入代码前加
//2012-12-20修正服务器多生成的tq_webchat_url未生效的bug
//2013-5-2修改当前页url参数长度,将url中的#替换为$
//2013-6-6去掉打开会话窗口时写的上次会话时间、上次客服及会话次数as，因为不一定能按通，改为在webchat中写，更准
//2013-6-7as参数名改变
//2013-7-4修正当飘浮框加agentid参数时，且webUI不生成tq_webchat_url变量时导致的错误
//2013-11-5TQ_RQF，TQ_RQC，更改为默认-1，表示访客主动点击. 加值为4的情况
/*
请求内容 TQ_RQC 
1:弹出询问框,2:直接请求会话，即直接弹出会话窗口， 3.请求留言 


请求来源TQ_RQF
-1:客户端直接点击,无法统计的未知来源 如直接在地址栏中输入进入或点超链接形式进入
1:服务端自动请求，
2:客户端自动请求，
3:客户端手动请求，
4:坐席直接打开会话  
5:直接点击漂浮框进入
6:点击客服图标进入 
7:点迷你会话窗口的最大化按钮在新窗口中打开进入 

*/
//2013-11-6加网页媒体统计参数的提取及传递，非后台生成代码不支持，必须手动在非后台代码中加传第三方媒体参数
//2013-11-14加传行为监控服务器地址给会话及留言页
//2013-11-19在直接打开留言页时，加传xfrom参数
//2013-11-25修正TQ_RQF，TQ_RQC不能正确赋值的bug
//2014-12-25加传当前会话来源信息三个参数
//2015-5-26修改skype用的js的下载地址
//2015-7-30又去掉当前会话来源信息三个参数
//2015-9-7加支持统计功能的“超链接加js简洁模式”。前提是先要嵌入标准的只用于统计分析的代码 TQKF.OpenChat("chat",8008115)
//2015-9-15尝试解决uc浏览器下弹出窗口被拦截的问题TQKF.OpenChat
//2015-10-17尝试解决手机中总在当前页中打开会话页面的问题
//2015-12-8加飘浮框上支持自定义css的支持
//2016-1-29修正传递的url中的?号问题
/*
<script>
var tqUserDefined=
	{
		openWinType:2//全屏打开
	}
</script>
*/
//2014-4-27	加带收缩状态的飘浮框关闭方式自定义，1：点关闭按钮 0：鼠标离开关闭.默认为1
/*
<script>
var tqUserDefined=
	{
		floatMaxStatusCloseMode:"0"//全屏打开
	}
</script>
*/
//2016-1-18提取url到配置文件
//2016-10-10多语言加兼容以前ltype=100代表英文的问题
//2016-12-18去掉状态图标的多语言分类
//2017-6-21修正留言还走pageinfo而导致接入会话的问题
//2017-6-26修正在合成form元素时，因数组原型被第三方网站改写而导致出错的问题
//2017-7-3解决post的=号问题导致内容缺失
var TQKF = 
{
	version				: "20100501",
	date				: "2017-7-3",
	js_url				: TQURLConfig.cdnDomain+"/js/vip/100501/",
	image_url			: TQURLConfig.cdnDomain+"/",
	swf_url				: TQURLConfig.cdnDomain+"/js/vip/",
	vip_server_url		: TQURLConfig.vipDomain,
	leave_msg_url		: TQURLConfig.leavemsgDomain,
	freecall_url		: TQURLConfig.freecallDOmain,
	invite_server_url	: TQURLConfig.inviteDomain,
	webchat_url			: TQURLConfig.webchatDomain,
	domain_url			: "http://weibo.com/tqcn?m=tqpf_"+tq_adminid, //"http://www.jingling.com?m=tqpf_"+tq_adminid,
	feefree_invite_server_url : TQURLConfig.feefreeInviteDomain+":8000",//免费版
	feefree_webchat_url2	: TQURLConfig.feefreeWebchatDomain+"/sendmain.jsp",//免费版
	feefree_leavemsg_url	: TQURLConfig.leavemsgDomain+"/vip/leavemsg.do",//免费版
	isUpdateOnlineFlag	: (typeof(tq_is_update_online_flag) == 'undefined' || tq_is_update_online_flag == '') ? 0 : tq_is_update_online_flag,//是否每隔一定间隔自动更新在线状态
	float_server_url	: (typeof(tq_floatserver_url) == 'undefined' || tq_floatserver_url == '') ? TQURLConfig.floatDomain : tq_floatserver_url,
	getOnlineFlagInteval: 1000 * 2,//自动更新在线状态的时间间隔
	hashChatURL			: (typeof(tq_hashchat_url) == 'undefined' || tq_hashchat_url == '')?"":tq_hashchat_url,//散列的会话地址，由飘浮框服务器赋值
	hashActionMonitorURL:(typeof(tq_hashactionmonitor_url) == 'undefined' || tq_hashactionmonitor_url == '')?"":tq_hashactionmonitor_url,//散列的行为监控服务器地址，由飘浮框服务器赋值
	local_url_length	: 400,
	reffer_url_length	: 300,
	//以下单位为毫秒
	getIsNewMsgIntever			: 1000*10,	//迷你会话层最小化时，请求是否有新消息的时间间隔
	appDelayTime				: 1000*1,	//询问框发上线消息发过1秒后，发获取邀请会话的客服号的请求
	appInterval					: tq_if_tryout == 0 ? 6*1000:5*1000,	//请求是否有客服邀请会话的初始时间间隔,以后每次请求时间间隔递增2秒,但上限为17秒

	//以下单位为分钟

	not_reshow_time				: (typeof(tq_invit_show_time) == 'undefined' || tq_invit_show_time == '')?3:tq_invit_show_time,		//分钟内只允许弹出一次
	not_reshow_time_site		: (typeof(tq_invit_domain_show_time) == 'undefined' || tq_invit_domain_show_time == '')?10:tq_invit_domain_show_time,//分钟内,只在浏览网站第一个页面时弹出一次邀请框
	auto_reshow_time			: (typeof(tq_invit_reshow_inteval) == 'undefined' || tq_invit_reshow_inteval == '')?15:tq_invit_reshow_inteval,		//拒绝邀请后，过15秒再次自动弹出
	mini_interval_of_bad_click	: 60,		//多长时间内的多次点击认定为恶意点击
	source_page_life_time		: 30,		//访问来源的有效期
	open_win_w					: 600,
	open_win_h					: 480,
	tq_media_param_name:"tq_media_param",//网页媒体参数名
	tq_media_param_value:"",//网页媒体参数值

	//访恶意点击的来源探索引擎
	filterURLs: [{
		domain: ["baidu.com", "baidu.com.cn", "baidu.cn"],
		keyPara: "wd"
	},
	{
		domain: ["google.com", "google.com.cn", "google.cn", "google.com.hk"],
		keyPara: "q"
	},
	{
		domain: ["sogou.com", "sogou.com.cn", "sogou.cn"],
		keyPara: "query"
	},
	{
		domain: ["soso.com", "soso.com.cn", "soso.cn"],
		keyPara: "w"
	},
	{
		domain: ["yahoo.com"],
		keyPara: "p"
	},
	{
		domain: ["yahoo.cn"],
		keyPara: "q"
	}],
	color						: ["#AECEF8","#58B7F6","#EEB3F7","#F67171","#FAB776","#F9DB9F","#90DA94","#8FD2C3","#DDE0E2","#606060"],
	miniChatColor				: ["#AECEF8","#58B7F6","#EEB3F7","#F67171","#FAB776","#F9DB9F","#90DA94","#8FD2C3","#74b0ff","#606060"],
	miniChatBorderColor			: ["#AECEF8","#58B7F6","#EEB3F7","#F67171","#FAB776","#F9DB9F","#90DA94","#8FD2C3","#74b0ff","#606060"],
	isFlashFixed				: false,
	OFFLINE: "0",
	ONLINE: "22|28",
	BUSY: "24|33",
	LEAVE: "26|25|23|20",
	/**
	creatDOMType			1:appendDOM 2:document.write
	forceLoadRequiredJS		默认为3秒后自动去加载JS,要想取消自动加载，需将其值定义成-1
	forceWriteCSS			0:不重复加载，1:用documet.wirte方式再加载一次
	debug					0:关闭，1-3:开启
	*/

	directchat_config : 
		[{
			status:0,//是否开启直接对话窗口，1：开启，0：关闭
			color:"ff00ff",//颜色值去掉#号
			size:{h:460,w:370},//直接对话窗口大小
			pos:{t:"b",l:"r"},//直接对话窗口位置，t:垂直位置,t为顶部，c为中间,b为底部；l:水平位置，r为右边，l为左边，c为中间
			title:"在线咨询",//直接对话窗口标题
			m:[{t:"tq",id:"",o:0}],//直接对话窗口的应该座席,type:应答座席类型，tq为单个座席,tactic为策略;id为指定的座席或策略号
			autoshow:5//自动弹出延迟时间，单位为秒
		}]
};
TQKF.userDefined= 
		{
			floatJS:TQKF.js_url+"float.js",
			inviteJS:TQKF.js_url+"invite.js",
			kefuImgJS:TQKF.js_url+"kefuimg.js",
			minimessJS:TQKF.js_url+"minimess_core.js",
			asJS:TQKF.js_url+"as.js",
			antibadclickJS:TQKF.js_url+"antibadclick.js",
			directchatJS:TQKF.js_url+"directchat.js",
			minichatJS:TQKF.js_url+"minichat.js",
			skypeJS:"http://download.skype.com/share/skypebuttons/js/skypeCheck.js",//"http://skype.tom.com/script/skypeCheck40.js",
			inviteInitDelay:500,//为了解决在IE6下，有的网站加载太慢，而导致当生成DOM后太快的appendDOM时，会导致IE死掉的问题
			inviterHideByScroll:0,//当页面滚动条滚动到某个位置时，自动隐藏询问框，为0时，则不开启
			defer:false,
			forceLoadRequiredJS:3,
			forceWriteCSS:0,
			debug:0,
			creatDOMType:1,
			loadCSSType:"auto",
			tacticFloaterWidth:"auto",
			appendDOMType:"insertBefore",
			isfloat:1,//2011-5-17梁丽需求飘浮框是否飘浮的TQ8上线前的临时解决方案
			float_member_h:"auto",//飘浮框成员的高度
			maxFloatMemberNameChars:8,//飘浮框中客服名字在一行显示的最多字数，超过此字数则自动折行，一个汉字占两个字数，一个英文占一个字数
			openWinType	: 1,//1,留言页全屏 2:post form 3:window.open 
			isNotCreatInvit:"0",//2010-12-5医疗行业自定义询问框的需求，当等于1时，我们不再生成询问框，用自定义的
			//以下两个变量只有当是客服图标形式时，才可进行此配置，否则会有错的。
			floatMaxStatusCloseMode:"1",//带收缩状态的飘浮框关闭方式，默认为1：点关闭按钮 0：鼠标离开关闭
			
			float_reshow_type				: (typeof(tq_float_reshow_type) == 'undefined' || tq_float_reshow_type == '')?0:tq_float_reshow_type,		//分钟内只允许弹出一次
			float_show_time			: (typeof(tq_float_show_time) == 'undefined' || tq_float_show_time == '')?3:tq_float_show_time,		//分钟内只允许弹出一次
			float_show_time_site		: (typeof(tq_float_domain_show_time) == 'undefined' || tq_float_domain_show_time == '')?10:tq_float_domain_show_time,//分钟内,只在浏览网站第一个页面时弹出一次邀请框
			float_reshow_inteval			: (typeof(tq_float_reshow_inteval) == 'undefined' || tq_float_reshow_inteval == '')?15:tq_float_reshow_inteval,		//拒绝邀请后，过15秒再次自动弹出

			
			kefuCloseArea:
			{
				isShow			:0,			//是否在客服图标上显示关闭按钮区域
				width			:20,	//关闭按钮区域的宽度
				height			:"20",	//关闭按钮区域的高度
				rightSpace		:"5",		//关闭按钮区域距客服图片右边的距离
				top				:"5"
			},
			kefuMiniArea:
			{
				isShow			:0,			//是否在客服图标上显示最小化按钮区域
				width			:"20",	//最小化按钮区域的宽度
				height			:"20",	//最小化按钮区域的高度
				rightSpace		:"5",		//最小化按钮区域距右边元素的距离，若右边有关闭按钮，则为距关闭按钮的距离，若右边无关闭按钮，则为距客服图片右边的距离
				miniImgOffline	:"a.gif",	//在线时最小化的图片
				miniImgOnline	:"b.gif",	//离线时最小化的图片
				miniImgWidth	:"80",	//最小化的图片的宽度
				miniImgHeight	:"30",	//最小化的图片的高度
				miniPos			:"RB"		//最小化的图片的位置。可选值为LB(左下角)和RB（右下角）
			},
			kefuClickEvent:null
		};
//2013-11-14
TQ_RQF="-1";
TQ_RQC="-1";

if(typeof(tq_webadmin_url) != "undefined" && tq_webadmin_url != "")
{
	TQKF.vip_server_url = tq_webadmin_url;
	TQKF.leave_msg_url	= tq_webadmin_url;
	TQKF.freecall_url	= tq_webadmin_url;
}
//不知到底是大写还是小写，防错一下
if(typeof(tq_WebAdmin_url) != "undefined" && tq_WebAdmin_url != "")
{
	TQKF.vip_server_url = tq_WebAdmin_url;
	TQKF.leave_msg_url	= tq_WebAdmin_url;
	TQKF.freecall_url	= tq_WebAdmin_url;
}
//因为已经将http://vip.tq.cn/vip/改为http://vip.tq.cn，以方便代理定制，而又不知道以前规定的tq_webadmin_url是怎么约定的。
if(TQKF.vip_server_url.indexOf("/vip/") != -1 )
{
	TQKF.vip_server_url = TQKF.vip_server_url.replace("/vip/","");
	TQKF.leave_msg_url	= TQKF.vip_server_url;
	TQKF.freecall_url	= TQKF.vip_server_url;
}

if(typeof(tq_admin_url) != "undefined" && tq_admin_url != "")
{
	TQKF.vip_server_url = tq_admin_url;
	TQKF.leave_msg_url	= TQKF.vip_server_url;
	TQKF.freecall_url	= TQKF.vip_server_url;
}

//2017-8-31加单独迷你会话设置
if(typeof(tq_directchat_config) != "undefined" && tq_directchat_config != "")
{
	if(typeof(tq_directchat_config) == "string")
		eval('TQKF.directchat_config ='+ tq_directchat_config);
	else
		TQKF.directchat_config = tq_directchat_config;
}

TQKF.isAgent		= (typeof(tq_chat_url) != "undefined" || typeof(tq_admin_url) != "undefined" || typeof(tq_card_url) != "undefined"|| typeof(tq_chat_logo) != "undefined") ;

//TQKF.page_url		= "";//引用页
TQKF.reffer_url		= "";//top.document.referrer;//引用页，防恶意点击用,向访客接待发上线消息用
TQKF.reffer_title	= "";//引用页标题

TQKF.local_url		= "";//当前页
TQKF.visit_title	= "";//当前页标题

TQKF.source_reffer_url= "";//来源页
TQKF.source_title	= "";//来源页标题

TQKF.current_visit_time	= "";//本次访问网站的来访时间
TQKF.current_first_url		= "";//本次访问网站的首个页面
TQKF.current_source_url	= "";//本次访问网站的来源页面





TQKF.float_image_url	= TQURLConfig.cdnDomain+"/images/vip/float/100501/",
TQKF.invite_image_url	= TQURLConfig.cdnDomain+"/images/vip/invit/100501/",// "http://sysimages.tq.cn/images/vip/",//"../images/vip/",
TQKF.kefuimg_image_url	= TQURLConfig.cdnDomain+"/images/vip/kefuimg/100501/",
TQKF.directchat_image_url	= TQURLConfig.cdnDomain+"/images/vip/directchat/",
TQKF.leavemsg_url		= TQURLConfig.leavemsgDomain+"/vip/leavemsg.do";//留言，通常要走pageinfo
TQKF.webchat_url2		= TQKF.webchat_url+"/sendmain.jsp";//会话，通常要走pageinfo
TQKF.pageinfo_url		= TQKF.webchat_url+"/sendmain.jsp";//排队
TQKF.directchat_url		= TQKF.webchat_url+"/directchat.jsp";//直接会话窗口

TQKF.winSize	= window.screen.width +"*"+window.screen.height;
TQKF.winColor	= window.screen.colorDepth;
TQKF.isFloater	= (tq_type==""||tq_type=="1"||tq_type=="4");
TQKF.isKefuImg	= (tq_type=="2");
if( (typeof(tq_useraccount)=="undefined" || tq_useraccount == "" || tq_useraccount < "1") && tq_type=="3" )
	TQKF.isInviter = 1;
else
	TQKF.isInviter	= tq_useraccount;//(tq_useraccount > "0" || tq_type=="3");//2010-3-8增加了仅用统计功能的支持 2011-4-20增加用于统计和监控
TQKF.isMinimess = (typeof(tq_is_minimess)!="undefined" && tq_is_minimess == 1);

//2010-2-22
TQKF.isMinimessLoaded	= false;
TQKF.jsloaded			= false;
TQKF.ltype_str			= "";
TQKF.uingroup			= "";
TQKF.onlineUins			= new Array();
TQKF.words				= new Array();
TQKF.words_zh			= new Array();
TQKF.words_en			= new Array();
TQKF.words_ru			= new Array();
TQKF.words_es			= new Array();

TQKF.languageList = 
{
	"1":"zh",
	"2":"en",
	"3":"ru",
	"4":"es"
};

TQKF.floater			= new Object();
TQKF.inviter			= new Object();
TQKF.AS					= new Object();
TQKF.miniChat			= new Object();
TQKF.miniChatmini		= new Object();
TQKF.mess				= new Object();
TQKF.antiBadClick		= new Object();
TQKF.clientInfo			= new Object();
TQKF.cookieObject_all	= new Object();//as cookie中存在的信息格式为：{"u8008115":{"adminUin":8008115,.....},"u8008118":{"adminUin":8008118,.....}.......}

TQKF.words_zh[0]=unescape("TQ%u6D3D%u8C08%u901A");//TQ洽谈通TQ%u6D3D%u8C08%u901A
TQKF.words_zh[1]=unescape("%u5173%u95ED");//关闭
TQKF.words_zh[2]=unescape("%u7F51%u7AD9%u7BA1%u7406%u5458%u8BF7%u6C42%u548C%u60A8%u901A%u8BDD%uFF08%u672C%u7CFB%u7EDF%u7531TQ%u63D0%u4F9B%uFF09");
TQKF.words_zh[3]=unescape("%u70B9%u51FB%u54A8%u8BE2");//点击咨询
TQKF.words_zh[4]=unescape("%u60A8%u597D%uFF01%u80FD%u4E3A%u60A8%u505A%u4E9B%u4EC0%u4E48%u5417%uFF1F");//您好！能为您做些什么吗？
TQKF.words_zh[5]=unescape("%u5B8C%u6BD5");//完毕
TQKF.words_zh[6]=unescape("%u70B9%u51FB%u7559%u8A00");//点击留言
TQKF.words_zh[7]=unescape("%u5728%u65B0%u7A97%u53E3%u4E2D%u6253%u5F00");//在新窗口中打开
TQKF.words_zh[8]=unescape("%u6700%u5C0F%u5316");//最小化
TQKF.words_zh[9]=unescape("\n\n%u8B66%u544A%uFF01%u672C%u7AD9%u53D1%u73B0%u6076%u610F%u70B9%u51FB%u5ACC%u7591%uFF0C%u60A8%u5DF2%u88AB%u5217%u5165%u9ED1%u540D%u5355%uFF0C\n\n\n\n%u8BF7%u7ACB%u5373%u7EC8%u6B62%u6076%u610F%u884C%u4E3A%u5E76%u91CD%u542F%u7535%u8111%uFF0C%u5426%u5219%u7535%u8111%u5C06%u53D7%u635F%uFF01\n\n");
	//警告！本站发现恶意点击嫌疑，您已被列入黑名单， 请立即终止恶意行为并重启电脑，否则电脑将受损！
TQKF.words_zh[10]=unescape("%u8BA4%u5B9A%u6076%u610F%u70B9%u51FB%uFF01");
TQKF.words_zh[11]=unescape("%u786E%u5B9A%u8981%u9000%u51FA%u5417?");//确定要退出吗？
TQKF.words_zh[12]=unescape("%u5728%u7EBF");//在线
TQKF.words_zh[13]=unescape("%u7559%u8A00");//留言
TQKF.words_zh[14]=unescape("%u514D%u8D39%u7535%u8BDD");//免费电话
TQKF.words_zh[15]=unescape("%u6B22%u8FCE%u60A8%uFF0C%u6765%u81EA%24%7Barea%7D%u7684%u5BA2%u4EBA%uFF01");//欢迎您，来自${area}的客人！
TQKF.words_zh[16]=unescape("%u8FD8%u539F");//还原
TQKF.words_zh[17]=unescape("%u7E41%u5FD9");//繁忙
TQKF.words_zh[18]=unescape("%u7F51%u7AD9%u7BA1%u7406%u5458%u8BF7%u6C42%u548C%u60A8%u901A%u8BDD");//网站管理员请求和您通话
TQKF.words_zh[19] = unescape("%u79BB%u5F00");
TQKF.words_zh[20] = unescape("%u5728%u7EBF%u5BA2%u670D");//在线客服

/*
TQKF.words_en[0]="TQ Messenger";//TQ Messenger
TQKF.words_en[1]="close";
TQKF.words_en[2]="Apply to talk with you! (Powered by TQ.CN)";
TQKF.words_en[3]="Click here";
TQKF.words_en[4]="Hello!Can I help you?";
TQKF.words_en[5]="finish";
TQKF.words_en[6]="Message";
TQKF.words_en[7]="Open in new Window";
TQKF.words_en[8]="Minimize";
TQKF.words_en[9]="Worning!You had written in blacklist for your bad clicking,please stop to do so,or your computer will be harmed!";
TQKF.words_en[10]="bad click!";
TQKF.words_en[11]="are you sure to exit?";
TQKF.words_en[12]="Online";
TQKF.words_en[13]="Msg";
TQKF.words_en[14]="Free Call";
TQKF.words_en[15]="Welcome, visitor from ${area}!";
TQKF.words_en[16]="Restore";
TQKF.words_en[17]="Busy";
TQKF.words_en[18]="Apply to talk with you!";
TQKF.words_en[19] = "Leave";
TQKF.words_en[20] = "Live Chat";//在线客服
*/
//英文
TQKF.words_en[0]="TQ Messenger";
TQKF.words_en[1]="Close";
TQKF.words_en[2]="Administrator apply to talk with you! (Powered by TQ.CN)";
TQKF.words_en[3]="Click on the consultion";
TQKF.words_en[4]="Hello!Can I help you?";
TQKF.words_en[5]="Done";
TQKF.words_en[6]="Leave a message";
TQKF.words_en[7]="Open in the new Window";
TQKF.words_en[8]="Minimize";
TQKF.words_en[9]="Warning!You have been blacklisted for suspected malicious click,please stop immediately and restart the computer,or your computer will be harmed!";
TQKF.words_en[10]="bad click!";
TQKF.words_en[11]="are you sure to exit?";
TQKF.words_en[12]="Online";
TQKF.words_en[13]="Leave a message";
TQKF.words_en[14]="Free Call";
TQKF.words_en[15]="Welcome, visitor from ${area}!";
TQKF.words_en[16]="Restore";
TQKF.words_en[17]="Busy";
TQKF.words_en[18]="Administrator apply to talk with you!";
TQKF.words_en[19]="Leave";
TQKF.words_en[20]="Online customer service";



//俄文
TQKF.words_ru[0]=unescape("TQ%20%u0432%u0435%u0441%u0442%u043D%u0438%u043A");//TQ вестник
TQKF.words_ru[1]=unescape("%u0413%u043E%u0442%u043E%u0432");//Готов
TQKF.words_ru[2]=unescape("%u0412%u0435%u0431-%u043C%u0430%u0441%u0442%u0435%u0440%20%u0437%u0430%u043F%u0440%u043E%u0441%u0438%u0442%u044C%2C%u0447%u0442%u043E%u0431%u044B%20%u0432%u0430%u043C%20%u0437%u0432%u043E%u043D%u0438%u0442%u044C%21%20%28%u043F%u0440%u0435%u0434%u043E%u0441%u0442%u0430%u0432%u043B%u044F%u0435%u043C%20TQ.CN%29");//Веб-мастер запросить,чтобы вам звонить! (предоставляем TQ.CN)
TQKF.words_ru[3]=unescape("%u0421%u043F%u0440%u043E%u0441%u0438%u0442%u044C");//Спросить
TQKF.words_ru[4]=unescape("%u0417%u0434%u0440%u0430%u0432%u0441%u0442%u0432%u0443%u0439%u0442%u0435%21%20%u0427%u0442%u043E%20%u043C%u044B%20%u043C%u043E%u0436%u0435%u043C%20%u0432%u0430%u043C%20%u043F%u043E%u043C%u043E%u0433%u0430%u0442%u044C%3F");//Здравствуйте! Что мы можем вам помогать?
TQKF.words_ru[5]=unescape("%u0413%u043E%u0442%u043E%u0432");//Готов
TQKF.words_ru[6]=unescape("%u041E%u0441%u0442%u0430%u0432%u0438%u0442%u044C%20%u0441%u043E%u043E%u0431%u0449%u0435%u043D%u0438%u0435");//Оставить сообщение
TQKF.words_ru[7]=unescape("%u041E%u0442%u043A%u0440%u044B%u0442%u044C%20%u0432%20%u043D%u043E%u0432%u043E%u043C%20%u043E%u043A%u043D%u0435");//Открыть в новом окне
TQKF.words_ru[8]=unescape("%u041C%u0438%u043D%u0438%u043C%u0438%u0437%u0430%u0446%u0438%u044F");//Минимизация
TQKF.words_ru[9]=unescape("%u0412%u044B%u0433%u043E%u0432%u043E%u0440%21%u0412%u044B%20%u043D%u0430%u043F%u0438%u0441%u0430%u043B%u0438%20%u0432%20%u0447%u0435%u0440%u043D%u044B%u0439%20%u0441%u043F%u0438%u0441%u043E%u043A%20%u0437%u0430%20%u0441%u0432%u043E%u0438%20%u043F%u043B%u043E%u0445%u0438%u0435%20%u043D%u0430%u0436%u0430%u0442%u0438%u0435%u043C%2C%20%u043F%u0440%u0435%u043A%u0440%u0430%u0442%u0438%u0442%u0435%20%u043D%u0435%u043C%u0435%u0434%u043B%u0435%u043D%u043D%u043E%2C%u0442%u043E%20%u0432%u0430%u0448%u0435%u043C%u0443%20%u043A%u043E%u043C%u043F%u044C%u044E%u0442%u0435%u0440%u0443%20%u0431%u0443%u0434%u0435%u0442%20%u043D%u0430%u043D%u0435%u0441%u0435%u043D%20%u0432%u0440%u0435%u0434%21");//Выговор!Вы написали в черный список за свои плохие нажатием, прекратите немедленно,то вашему компьютеру будет нанесен вред!
TQKF.words_ru[10]=unescape("%u041F%u043B%u043E%u0445%u043E%20%u043D%u0430%u0436%u043C%u0438%u0442%u0435%21");//Плохо нажмите!
TQKF.words_ru[11]=unescape("%u0412%u044B%u0445%u043E%u0434%u0438%u0442%u0435%3F");//Выходите?
TQKF.words_ru[12]=unescape("%u041E%u043D%u043B%u0430%u0439%u043D");//Онлайн
TQKF.words_ru[13]=unescape("%u041E%u0441%u0442%u0430%u0432%u0438%u0442%u044C%20%u0441%u043E%u043E%u0431%u0449%u0435%u043D%u0438%u0435");//Оставить сообщение
TQKF.words_ru[14]=unescape("%u0411%u0435%u0441%u043F%u043B%u0430%u0442%u043D%u044B%u0439%20%u0432%u044B%u0437%u043E%u0432");//Бесплатный вызов
TQKF.words_ru[15]=unescape("%u041F%u0440%u0438%u0432%u0435%u0442%u0441%u0442%u0432%u0443%u0435%u043C%2C%20%u043F%u0440%u0438%u0448%u0435%u0434%u0448%u0438%u0439%20%u043F%u0440%u0438%u0435%u0445%u0430%u043B%20%24%7Barea%7D%21");//Приветствуем, пришедший приехал ${area}!
TQKF.words_ru[16]=unescape("%u0412%u043E%u0441%u0441%u0442%u0430%u043D%u043E%u0432%u0438%u0442%u044C%20");//Восстановить 
TQKF.words_ru[17]=unescape("%u0417%u0430%u043D%u044F%u0442%u043E");//Занято
TQKF.words_ru[18]=unescape("%u0412%u0435%u0431-%u043C%u0430%u0441%u0442%u0435%u0440%20%u0437%u0430%u043F%u0440%u043E%u0441%u0438%u0442%u044C%2C%u0447%u0442%u043E%u0431%u044B%20%u0432%u0430%u043C%20%u0437%u0432%u043E%u043D%u0438%u0442%u044C%21%20");//Веб-мастер запросить,чтобы вам звонить! 
TQKF.words_ru[19] = unescape("%u0412%u044B%u0439%u0442%u0438%20%u0438%u0437%20%u0441%u0435%u0442%u0438%20");//Выйти из сети 
TQKF.words_ru[20] = unescape("%u041E%u043D%u043B%u0430%u0439%u043D%20%u043E%u0431%u0441%u043B%u0443%u0436%u0438%u0432%u0430%u043D%u0438%u0435%20%u043A%u043B%u0438%u0435%u043D%u0442%u043E%u0432");//Онлайн обслуживание клиентов
 


//西班牙文
TQKF.words_es[0]="la conversación de TQ";
TQKF.words_es[1]="Cerrar";
TQKF.words_es[2]="El administrador del sitio web pide hablar con usted（Este sistema es proporcionada por TQ）";
TQKF.words_es[3]="Haga clic en la consulta";
TQKF.words_es[4]="¡Hola!¿Qué podemos hacer por usted?";
TQKF.words_es[5]="Terminar";
TQKF.words_es[6]="Haga clic en el mensaje";
TQKF.words_es[7]="Abrir en una nueva ventana";
TQKF.words_es[8]="Minimizar";
TQKF.words_es[9]="¡Advertencia！¡Sitio encontró clics maliciosos sospechan que usted ha estado en la lista negra, resolver de modo inmediato el comportamiento malicioso y reinicie el ordenador, de lo contrario el ordenador será dañado！";
TQKF.words_es[10]="Identificar un clic!";
TQKF.words_es[11]="¿Seguro que quieres salir?";
TQKF.words_es[12]="En la linea";
TQKF.words_es[13]="Dejar un mensaje";
TQKF.words_es[14]="Llamada gratuita";
TQKF.words_es[15]="¡Bienvenido,los huéspedes de ${area}!";
TQKF.words_es[16]="Reducción";
TQKF.words_es[17]="Ocupado";
TQKF.words_es[18]="El administrador del sitio web pide hablar con usted!";
TQKF.words_es[19]="Salir";
TQKF.words_es[20]="Servicio en línea";


//此方法的已有参数顺序不能改！去哪网在调用此方法
TQKF.CreatURL	= function (url,action,uin,typecode,clickSource)
{
	//请求来源 TQ_RQF ，-1客户端直接点击,无法统计的未知来源 如直接在地址栏中输入进入或点超链接形式进入 1 服务端自动请求， 2客户端自动请求， 3客户端手动请求，4坐席直接请求会话 5 直接点击漂浮框进入 6 点击客服图标进入  7 点迷你会话窗口的最大化按钮在新窗口中打开进入  
	
	if(TQ_RQF == "-1")
	{
		TQ_RQF = "-1";
		if(clickSource == "float")
			TQ_RQF = 5;
		else if(clickSource == "invite")
			TQ_RQF = 1;
		else if(clickSource == "kefuimg")
			TQ_RQF = 6;
		else if(clickSource == "minichat")
			TQ_RQF = 4;
		else if(clickSource == "minichatMax")
			TQ_RQF = 7;
		else if(clickSource == "unknown")
			TQ_RQF = "-1";
	}
	

	//请求内容 TQ_RQC 1:弹出询问框,2:直接请求会话，即直接弹出会话窗口， 3.请求留言
	if(TQ_RQC == "-1")
	{
		TQ_RQC = "-1";
		if(clickSource == "invite")
		{
			TQ_RQC = 1;
		}
	}
	if(!TQUtils.IsUndefined('tq_clientname'))
	{
		if(tq_clientname.indexOf("^") == -1)
		{
			tq_clientname = encodeURI(tq_clientname).replace(/%/gi,"^");
		}
	}
	var argv = TQKF.CreatURL.arguments;
	var argc = TQKF.CreatURL.arguments.length;
	var str = "?";
	var _siteid="";
	var _charset = (document.characterSet||document.charset);
	/*if(!(TQUtils.IsUndefined('siteid') || siteid=="") )
		_siteid = siteid;
	*/

	if(!(TQUtils.IsUndefined('tq_siteid') || tq_siteid=="") )
		_siteid = tq_siteid;
	if(url.indexOf("?") != -1)
		str = "&";
	var tracq_url=url+str+"action="+action+
		"&admiuin="+tq_adminid+
		((uin=="")?"":"&uin="+uin)+
		((action.indexOf("acd") == -1 )?"":("&acd=1&type_code="+(typecode=="undefined" || typecode==""||typecode==null ? tq_tactic_id:typecode)))+
		"&RQF="+TQ_RQF+
		"&RQC="+TQ_RQC+
		"&xfrom=-1"+
		"&ltype="+tq_language+
		"&sort="+tq_sort+
		"&charset="+_charset+
		"&lasttalkuin="+((TQUtils.IsUndefined('TQKF.clientInfo')|| TQUtils.IsUndefined('TQKF.clientInfo.pu') || TQKF.clientInfo.pu=="undefined")?"":this.clientInfo.pu)+
		((this.chattype == '')?"":"&chattype="+this.chattype+"&isnoshowuser="+tq_kefuimg_cfg.isnoshowuser+"&uingroup="+this.uingroup)+//在线客服形式
		"&rand="+((TQUtils.IsUndefined('TQKF.clientInfo')|| TQUtils.IsUndefined('TQKF.clientInfo.r'))?"":this.clientInfo.r)+
		"&comtimes="+((TQUtils.IsUndefined('TQKF.clientInfo')|| TQUtils.IsUndefined('TQKF.clientInfo.ct'))?"":this.clientInfo.ct)+
		"&iscallback="+tq_iscallback+
		(( TQUtils.IsUndefined('tq_isFullScreenLeavmsg') || tq_isFullScreenLeavmsg == '' )?"":"&isFullScreenLeavmsg="+tq_isFullScreenLeavmsg)+
		((this.tq_media_param_value=="")?"":"&"+this.tq_media_param_name+"="+this.tq_media_param_value)+
		
		"&agentid="+tq_agentid+
		((tq_clientid=="")?"":"&clientid="+tq_clientid)+
		((_siteid=="")?"":"&siteid="+_siteid)+
		(( TQUtils.IsUndefined('tq_page_templete_id') || tq_page_templete_id == '' )?"":"&page_templete_id="+tq_page_templete_id)+
		(( TQUtils.IsUndefined('tq_software_name') || tq_software_name == '' )?"":"&software_name="+tq_software_name)+
		(( TQKF.hashChatURL == '' )?"":"&hashChatURL="+TQKF.hashChatURL)+
		(( TQKF.hashActionMonitorURL == '' )?"":"&hashActionMonitorURL="+TQKF.hashActionMonitorURL)+
		"&isAgent="+(TQKF.isAgent==true?"1":"0")+
		(( TQUtils.IsUndefined('tq_is_message_sms') || tq_is_message_sms == '' )?"":"&is_message_sms="+tq_is_message_sms)+
		(( TQUtils.IsUndefined('tq_is_send_mail') || tq_is_send_mail == '' )?"":"&is_send_mail="+tq_is_send_mail)+
		(( TQUtils.IsUndefined('tq_chat_url') || tq_chat_url == '' )?"":"&chat_url="+tq_chat_url)+
		(( TQUtils.IsUndefined('tq_card_url') || tq_card_url == '' )?"":"&card_url="+tq_card_url)+
		(( TQUtils.IsUndefined('tq_chat_logo') || tq_chat_logo == '' )?"":"&chat_logo="+tq_chat_logo)+
		(( TQUtils.IsUndefined('tq_logoLink') || tq_logoLink == '' )?"":"&logoLink="+tq_logoLink)+
		(( TQUtils.IsUndefined('tq_admin_url') || tq_admin_url == '' )?"":"&admin_url="+tq_admin_url)+
		(( TQUtils.IsUndefined('tq_clientname') || tq_clientname == '' )?"":"&clientname="+tq_clientname)+
		(( TQUtils.IsUndefined('tq_infocard_url') || tq_infocard_url == '' )?"":"&tq_right_infocard_url="+tq_infocard_url)+
		(( TQUtils.IsUndefined('tq_visitor_head_img') || tq_visitor_head_img == '' )?"":"&visitor_head_img="+tq_visitor_head_img)+
		(( TQUtils.IsUndefined('tq_para1') || tq_para1 == '' )?"":"&para1="+tq_para1)+
		(( TQUtils.IsUndefined('tq_para2') || tq_para2 == '' )?"":"&para2="+tq_para2)+
		(( TQUtils.IsUndefined('tq_para3') || tq_para3 == '' )?"":"&para3="+tq_para3)+
		(( TQUtils.IsUndefined('tq_para4') || tq_para4 == '' )?"":"&para4="+tq_para4)+
		(( TQUtils.IsUndefined('tq_para5') || tq_para5 == '' )?"":"&para5="+tq_para5)+//可扩展的备用参数，主要供第三方使用
		((url.indexOf("sendmain.jsp") == -1 && url.indexOf("pageinfo.jsp") == -1)?("&page="+this.reffer_url):("&page="+this.reffer_url.replace(/\^/g,"%")))+
		"&localurl="+this.local_url+
		"&cvisit_time="+this.current_visit_time+
		//"&cfirst_url="+this.current_first_url+
		((url.indexOf("sendmain.jsp") == -1 && url.indexOf("pageinfo.jsp") == -1)?("&cfirst_url="+this.current_first_url):("&cfirst_url="+this.current_first_url.replace(/\^/g,"%")))+
		"&csource_url="+this.current_source_url+
		((url.indexOf("sendmain.jsp") == -1 && url.indexOf("pageinfo.jsp") == -1)?("&spage="+this.source_page_url):("&spage="+this.source_page_url.replace(/\^/g,"%")))+

		((TQKF.visit_title=="")?"":"&visittitle="+TQKF.visit_title)+
		//((TQKF.source_title=="")?"":"&sourcetitle="+TQKF.source_title)+
		//((TQKF.reffer_title=="")?"":"&reffertitle="+TQKF.reffer_title)+

		(TQUtils.IsUndefined('_tq_collect_page_type')?"":"&cpage="+_tq_collect_page_type);//_tq_collect_page_type是宏源用的
	return tracq_url;
};
/*
TQKF.OpenWindow		= function (url,uin)
{
	if(TQKF.userDefined.openWinType == 1)
	{
		if(url.indexOf("leavemsg") != -1 && tq_isFullScreenLeavmsg)
		{
			try
			{
				var cw=window.open(url);
				try
				{
					cw.focus();
				}
				catch (e1)
				{
				}
			}
			catch (e)
			{
				window.location=url;
			}
			
		}
		else
		{
			try
			{
				var cw=window.open(url,"tq_webchat","width="+this.open_win_w+",height="+this.open_win_h+",directories=no,location=no,resizable=1,scrollbars=0,status=no,toolbar=no,menu=no,top=100,left=200");
				try
				{
					cw.focus();
				}
				catch (e1)
				{
				}
				
			}
			catch(e)
			{
				window.location=url;
			}
			//
			this.clientInfo.tt=parseInt(this.clientInfo.tt)+1;
			this.clientInfo.lt = escape(TQUtils.GetTime_invite());
			if(typeof(uin)!= "undefind" && uin != "")
				this.clientInfo.pu = uin;
			try
			{
				this.AS.UpdateLastTalkUin(uin);
			}
			catch (e){}
			//
		}
	}
	else
	{
		var link=document.createElement('A');
		link.href=url;
		link.innerHTML="_";
		link.target='_blank';
		//document.body.appendChild(link);
		TQUtils.AppendDOM(link);
		//火狐3.0和 Chrome 浏览器 click()不支持方法改进
		var callClick = function (element)
		{
			if(element.click)
			{
				element.click();
			}
			else if(element.fireEvent)
			{
				element.fireEvent('onclick');
			}
			else if(document.createEvent)
			{
				var evt = document.createEvent("MouseEvents");
				evt.initEvent("click", true, true);
				element.dispatchEvent(evt); 
			}
		};
		callClick(link);
		link.parentNode.removeChild(link);

		//
		this.clientInfo.tt=parseInt(this.clientInfo.tt)+1;
		this.clientInfo.lv = escape(TQUtils.GetTime_invite());
		if(typeof(uin)!= "undefind" && uin != "")
			this.clientInfo.pu = uin;
		try
		{
			//this.AS.WriteCookie(this.clientInfo);
			this.AS.UpdateLastTalkUin(uin);
		}
		catch (e){}
		//
	}
};
*/

TQKF.OpenWindow = function(url, uin) {
	var _tmp = url.split("\?");
	var _url = _tmp[0];
	var _paras = _tmp[1];
	if(TQKF.userDefined.openWinType == 3)
	{
		window.open(url);
	}
	else if(TQKF.userDefined.openWinType == 1)
	{
		if (url.indexOf("leavemsg") != -1 && tq_isFullScreenLeavmsg) {
			try {
				var cw = window.open(url);
				try {
					cw.focus()
				} catch(e1) {}
			} catch(e) {
				window.location = url
			}
		} else {
			TQKF.OpenByForm(_url, _paras, 1)
		}
	}
	else {
		TQKF.OpenByForm(_url, _paras, 2)
	}
};
TQKF.OpenByForm = function(url, paras, openWinType) {
	var _form = document.createElement("form");
	_form.name = "tqtemp_form";
	_form.action = url;
	_form.method = "post";
	var newW;
	if (openWinType == 1) {
		newW = window.open("about:blank", "tq_webchat", "width=" + this.open_win_w + ",height=" + this.open_win_h + ",directories=no,location=no,resizable=1,scrollbars=0,status=no,toolbar=no,menu=no,top=100,left=200");
		_form.target = "tq_webchat";
	} 
	else
		_form.target = "blank";
	_form.style.display = "none";
	var paraList = paras.split("\&");
	var inputs = "";
	for (var i=0;i<paraList.length;i++) 
	{
		var nv = paraList[i].split("\=");
		try
		{
			if(typeof(paraList[i]) == "string")
			{
				var nv = paraList[i].split("\=");
				inputs +=("<input type=hidden name='" + nv[0] + "' value='" + nv[1] + "' \/>");
			}
		}
		catch (e)
		{
		}
	}
	_form.innerHTML = inputs;
	TQUtils.AppendDOM(_form);
	_form.submit();
	_form.parentNode.removeChild(_form)
};

/*
type		:打开窗口的类型,
					"chat":打开会话窗口，
					"leavemsg":打开留言窗口,需要指定uin
					"acd":排队策略,需要指定tactic_code,打开会话窗口或留言窗口，根据在线状态
					"acd&pagetype=leavemsg&tag=leavemsg":排队策略,需要指定tactic_code,打开留言窗口
					"acd&pagetype=leavemsg":排队策略,需要指定tactic_code,打开留言窗口并切到免费电话标签。
				使用示例：
					TQKF.OpenChat("chat","8008115");//打开会话窗口
					TQKF.OpenChat("leavemsg","8008115");//打开留言窗口
					TQKF.OpenChat("acd","201");//打开排队策略

	uin			:座席id号或策略号
*/
TQKF.OpenChat = function(_action,_uin)
{
	TQKF.OpenWindow(TQKF.CreatURL(_action=="leavemsg"?TQKF.leavemsg_url:TQKF.webchat_url2,_action,(_action.indexOf("acd") == -1?_uin:""),_uin,"unknown"));
};
TQKF.setWindowStatus = function()
{
	try
	{
		window.status=TQKF.words[5];
	}
	catch(e)
	{
	}
	setTimeout(TQKF.setWindowStatus,500);
};
TQKF.loadRequiredJS = function()
{
	if(TQKF.jsloaded == true)
	{	
		return;
	}
	try
	{
		TQ_DEBUG("TQKF.loadRequiredJS",3);
	}
	catch (e)
	{
	}
	TQKF.jsloaded = true;
	
	//setTimeout执行loadCSS时，会有错
	/*
	if(tq_type == "4" || tq_type == "1")
	{
		TQUtils.LoadCSS(TQKF.invite_image_url+"tracqfloat.css");
	}
	*/
	/*改为antibadclick.js用document.write方式加载，以解决有的网站打开速度慢而导致关闭页面时，antibackclick还没有运行的问题
	if(tq_is_anti_bad_click=="1")
		TQUtils.LoadJS(TQKF.js_url+'antibadclick.js',false);
	*/
	//以下为了兼容老的飘浮框服务器，等其上线后去掉
	//返回格式：var isOnline = false;var isalloffline=true;
	//if((tq_type=="2"&&tq_acd=="1" || tq_type=="3"&&tq_acd=="1") && typeof(isalloffline)=="undefined" && typeof(tq_isalloffline)=="undefined")//已经改为由飘浮框服务器直接将策略的在线状态加到floatcard中
		//TQUtils.LoadJS(TQKF.vip_server_url+'/vip/getOnlineFlag.do?adminuin='+tq_adminid+'&type_code='+tq_tactic_id+'&rand='+Math.random(),false);

	//以下为了兼容老的飘浮框服务器，等其上线后去掉
	//这个要放到float.js后面，因为若其下载速度太快的话，可能onload事件执行时，float.js还没下完
	//返回格式：var tq_tacticTermOnlineFlag = [true,false,false,true];var tq_tacticTermName = ["中文","上海","技术"];
	//if(tq_type == "4" && typeof(tq_tacticTermOnlineFlag)=="undefined")//已经改为由飘浮框服务器直接将策略组的在线状态加到floatcard中
		//TQUtils.LoadJS2(TQKF.vip_server_url+'/vip/getOnlineFlag.do?adminuin='+tq_adminid+'&type_code='+tq_language_type+'&type=4&rand='+Math.random(),function(){TQKF.floater.CreatDOM();setTimeout(TQKF.floater.Init,500);});

	/*
	if(TQKF.isFloater)
		TQUtils.LoadJS(TQKF.js_url+'float.js',TQKF.userDefined.defer);
	if(TQKF.isKefuImg)
		TQUtils.LoadJS(TQKF.js_url+'kefuimg.js',TQKF.userDefined.defer);
	if(TQKF.isInviter > 0)
	{
		//TQUtils.LoadCSS(TQKF.invite_image_url + "tq_invit_s" + tq_invit_style + "_t" + tq_displaytype + ".css");
		TQUtils.LoadJS(TQKF.js_url+'invite.js',TQKF.userDefined.defer);
	}
	if(TQKF.isMinimess)//只有为-1时，才为禁用  100206改为VIP默认不开通，免费用户默认开通 2010-2-24改为为0时为禁用，为1时为开通，为2时为只有客服离线才开通
	{
		//document.writeln('<scr'+'ipt src="'+TQKF.js_url+'minimess.js">\<\/scr'+'ipt\>');//此处不能用loadJS
		TQUtils.LoadJS(TQKF.js_url+'minimess_core.js',TQKF.userDefined.defer);
		TQKF.isMinimessLoaded = true;
	}
	*/
	if(typeof(tq_member_uins) != "undefined" && tq_member_uins != "" && tq_member_uins.indexOf("skype") != -1)
		TQUtils.LoadJS(TQKF.userDefined.skypeJS,TQKF.userDefined.defer);
	if(TQKF.isFloater && TQKF.userDefined.floatJS != "none")
		TQUtils.LoadJS(TQKF.userDefined.floatJS,TQKF.userDefined.defer);
	if(TQKF.isKefuImg && TQKF.userDefined.kefuImgJS != "none")
		TQUtils.LoadJS(TQKF.userDefined.kefuImgJS,TQKF.userDefined.defer);
	if(TQKF.isInviter > 0 && TQKF.userDefined.inviteJS != "none")
	{
		//TQUtils.LoadCSS(TQKF.invite_image_url + "tq_invit_s" + tq_invit_style + "_t" + tq_displaytype + ".css");
		TQUtils.LoadJS(TQKF.userDefined.inviteJS,TQKF.userDefined.defer);
	}
	if(TQKF.isMinimess)//只有为-1时，才为禁用  100206改为VIP默认不开通，免费用户默认开通 2010-2-24改为为0时为禁用，为1时为开通，为2时为只有客服离线才开通
	{
		//document.writeln('<scr'+'ipt src="'+TQKF.js_url+'minimess.js">\<\/scr'+'ipt\>');//此处不能用loadJS
		TQUtils.LoadJS(TQKF.userDefined.minimessJS,TQKF.userDefined.defer);
		TQKF.isMinimessLoaded = true;
	}
	if(TQKF.directchat_config[0].status ==1 && TQUtils.isInCode(TQKF.directchat_config[0].m[0].o, TQKF.ONLINE))
	{
		TQUtils.LoadJS(TQKF.userDefined.directchatJS,TQKF.userDefined.defer);
	}

	//2011-5-9加firebug-lite功能
	/*
	if(TQUtils.GetPara(window.location.href,"tq_debug") == "1")
	{
		TQUtils.LoadJS(TQKF.js_url+'firebug-lite.js',TQKF.userDefined.defer);
	}
	*/
};
TQKF.SetValue = function(from,to)
{
	for(var prop in to)
	{
		var temp = eval("typeof(tq_"+prop+")!='undefined' && tq_"+prop+"!= null && tq_"+prop+" != 'null' && tq_"+prop+" != ''");
		if(temp)
		{
			to[prop] = eval("tq_"+prop);
		}
	}
};

/**
@paras
	target		:需要单击打开会话功能的元素id

	type		:打开窗口的类型,
					"chat":打开会话窗口，
					"leavemsg":打开留言窗口,需要指定uin
					"acd":排队策略,需要指定tactic_code,打开会话窗口或留言窗口，根据在线状态
					"acd&pagetype=leavemsg&tag=leavemsg":排队策略,需要指定tactic_code,打开留言窗口
					"acd&pagetype=leavemsg":排队策略,需要指定tactic_code,打开留言窗口并切到免费电话标签。
				使用示例：
					TQKF.Binding("aa","chat","8008115");//打开会话窗口
					TQKF.Binding("aa","leavemsg","8008115");//打开留言窗口
					TQKF.Binding("aa","acd","","201");//打开排队策略

	uin			:座席id号

	tactic_code	:策略代码，若type为acd时，则可指定此参数的值，而uin的值必须赋为""，
				使用示例：
					TQKF.Binding("aa","acd","","201");
					如要使用排队功能来分座席，并且要打开留言页面，则可用如下示例：
					TQKF.Binding("aa","acd&pagetype=leavemsg","","201");
				若没有加此参数，则会使用嵌入代码中设置的询问框应答策略,
				使用示例：
					TQKF.Binding("aa","acd","");

	isHideUI	:可选参数，点击后，是否要隐藏某个指定的DOM元素，通常用于自定义的询问框,在点击某个按钮后，接通座席，并关闭询问框
				使用示例：
					TQKF.Binding("aa","chat","8008111","",true,"bb")

	UI			:要隐藏的DOM元素的id
**/
TQKF.Binding = function(target,type,uin,tactic_code,is_hide_ui,ui)
{
	if (typeof target == 'string')
		target = TQUtils.GetObj(target);
	if(target)
	{
		target.style.cursor = "pointer";
		TQUtils.AddEvent(target,"click",function()
		{
			try
			{
				TQKF.OpenWindow(TQKF.CreatURL(type=="leavemsg"?TQKF.leavemsg_url:TQKF.webchat_url2,type,uin,tactic_code?tactic_code:tq_tactic_id,"unknown"),uin);
				if(is_hide_ui)
				{
					if(typeof ui == 'string')
						ui = TQUtils.GetObj(ui);
					ui && (ui.style.display = "none");
				}
			}
			catch(e){}
		});
	}
};


var TQUtils = 
{
	tq_fixJQueryMouseMoveEvent : null,//修正drag函数对jquery的鱼眼效果的影响
	browserType		: navigator.userAgent.toLowerCase(),
	isDOM			: (document.getElementById ? true : false), 
	isNS4			: (document.layers ? true : false),
	isNS			: navigator.appName == "Netscape",
	IE				: ((navigator.appName.toLowerCase()=="microsoft internet explorer") && (parseInt(navigator.appVersion) >=4)),
	Chrome			: navigator.userAgent.toLowerCase().indexOf("chrome")!=-1,
	NS				: (document.layers) ? 1 : 0,
	isIE4			: document.all && !(document.getElementById),
	FF				: navigator.userAgent.toLowerCase().indexOf("firefox")!=-1,
	Se360			: navigator.userAgent.toLowerCase().indexOf("360se")!=-1,

	IsUndefined	: function(name)
	{
		return eval("typeof("+name+")=='undefined'");
	},
	SetValueIfUndefined	: function(name,value)
	{
		if(this.IsUndefined(name))
		{
			var tqtemp=value;
			eval(name+"=tqtemp");
		}
	},
	SetValueIfUndefinedOrEmpty : function(name,value)
	{
		if(this.IsUndefined(name) || eval(name)==="")
		{
			var tqtemp=value;
			eval(name+"=tqtemp");
		}
	},
	SetDefaultValue : function(name,value)
	{
		if(name == "")
			name = value;
	},
	LoadJS : function(url,isDefer)
	{
		try
		{
			var jsID	= "TQJS"+Math.random();
			var jsDOM	= document.createElement("script");
			//jsDOM.setAttribute("event","onload");
			//jsDOM.setAttribute("for","window");
			document.getElementsByTagName("head")[0].appendChild(jsDOM);
			jsDOM.id	= jsID;
			if(isDefer==true && TQUtils.IE==true)
				jsDOM.defer= "defer";
			jsDOM.src	= url;
		}
		catch (e)
		{
		}
		
	},
	/*
	支持JS加载完成时，自动调用某个函数
	*/
	LoadJS2 : function(url,callback)
	{
		var jsID	= "TQJS"+Math.random();
		var jsDOM	= document.createElement("script");
		document.getElementsByTagName("head")[0].appendChild(jsDOM);
		jsDOM.id	= jsID;
		jsDOM.src	= url;
		try
		{
			jsDOM.onreadystatechange = function(){if(jsDOM.readyState=="loaded")callback();} 
		}
		catch(e){}
		try
		{    
			jsDOM.onload = callback;
        }
		catch(e){}
	},
	/*
	在IE下，可以用同一个script块重复的指向某个URL，而不firefox下不能，
	在firefox下，可以将动态生成的指向域以外的script块删除掉，而在IE下不能。所以，如果是IE，就重复用一个script块,否则就动态创建，如果是firefox或chorme就创建后延时删除，其它的浏览器测不删除。
	*/
	/*
	LoadJSAndAutoRemoveSelf : function(scriptId,url)
	{
		if(this.IE)
		{
			this.GetObj(scriptId).src = url;
		}
		else
		{
			var jsID	= "TQJS"+Math.random();
			var jsDOM	= document.createElement("script");
			document.getElementsByTagName("head")[0].appendChild(jsDOM);
			jsDOM.id	= jsID;
			jsDOM.src	= url;
			if(this.FF || this.Chrome)
			{
				var callback = function()
				{
					try
					{
						setTimeout(function(){jsDOM.parentNode.removeChild(jsDOM);},2000);
					}
					catch (e)
					{
					}
				};
				try
				{
					jsDOM.onreadystatechange = function(){if(jsDOM.readyState=="complete" || jsDOM.readyState=="loaded")callback(); } 
				}
				catch(e){}
				try
				{    
					jsDOM.onload = callback;
				}
				catch(e){}
			}
		}
	},
	*/
	LoadJSAndAutoRemoveSelf: function(scriptId, url) {
		{
			var jsID = "TQJS" + Math.random();
			var jsDOM = document.createElement("script");
			document.getElementsByTagName("head")[0].appendChild(jsDOM);
			jsDOM.id = jsID;
			jsDOM.src = url; {
				var callback = function() {
					try {
						setTimeout(function() {
							if(jsDOM && jsDOM.parentNode)
								jsDOM.parentNode.removeChild(jsDOM);
						},
						2000)
					} catch(e) {}
				};
				try {
					jsDOM.onreadystatechange = function() {
						if (jsDOM.readyState == "complete" || jsDOM.readyState == "loaded") callback()
					}
				} catch(e) {}
				try {
					jsDOM.onload = callback
				} catch(e) {}
			}
		}
	},
	LoadCSS : function(url)
	{
		if(TQKF.userDefined.loadCSSType == "auto")//manual
		{
			try
			{
				var cssID	= "TQCSS"+Math.random();
				var cssDOM	= document.createElement("link");
				cssDOM.setAttribute("rel", "stylesheet");
				cssDOM.setAttribute("type", "text/css");
				cssDOM.rel="stylesheet";
				cssDOM.type="text/css";
				document.getElementsByTagName("head")[0].appendChild(cssDOM);
				cssDOM.id	= cssID;
				cssDOM.href	= url;
			}
			catch (e)
			{
			}
			if(TQKF.userDefined.forceWriteCSS == 1)//解决有时动态生成的CSS的href指向失败的问题
				document.write('<link rel="stylesheet" type="text/css" href="'+url+'"/>');	
		}
	},
	getCssTextById:function(id,cssText)
  {
	  var list = cssText.split("#");
	  if(list == null || list.length == 0)
		return '';
	  for(var i=0;i<list.length;i++)
	  {
		  if(list[i].indexOf(id) != -1)
		  {
			return ''+list[i].replace(id,'').replace("{",'').replace("}",'').replace("$",'#');
		  }
	  }
	  return '';
  },


	//参数dom不能用this表示
	AppendDOM : function(dom)
	{
		//
		if(TQKF.userDefined.appendDOMType == "appendChild")
		{
			try
			{
				document.body.appendChild(dom);
			}
			catch (e)
			{
				try
				{
					setTimeout(function(){document.body.appendChild(dom);},10000);
				}
				catch (e)
				{
				}
			}
		}
		else
		{
			try
			{
				document.body.insertBefore(dom,document.body.firstChild);
			}
			catch (e)
			{
				try
				{
					setTimeout(function(){document.body.appendChild(dom);},10000);
				}
				catch (e)
				{
				}
			}
		}
	},
	toJSONString : function(json)
	{
		if(Object.prototype.toJSONString)// || String.prototype.toJSONString
			return json.toJSONString();
		else
		{
			var s="{";
			for(var t in json)
			{
				//2012-4-11修正因Prototype.js入侵对象原型，使得对象转json时多出一个extend属性而导致访客信息写cookie不正常的问题
				if(typeof(json[t])=="function")
					continue;
				if(typeof(json[t])=="object" && json[t] != null)
				{
					s += (t+":"+this.toJSONString(json[t])+",");
				}
				else if(json[t] != null)
				{
					s += (typeof(json[t])=="number"?(t+":"+json[t]+","):(t+":"+"\""+json[t]+"\""+","));
				}
			}
			s = s.substring(0,s.length-1)+"}";
			return s;
		}
	},
	Drag :
	{
		canDrag:true,
		obj : null,

		init : function(o, oRoot, minX, maxX, minY, maxY, bSwapHorzRef, bSwapVertRef, fXMapper, fYMapper)
		{
			o.onmousedown	= TQUtils.Drag.start;

			o.hmode			= bSwapHorzRef ? false : true ;
			o.vmode			= bSwapVertRef ? false : true ;

			o.root = oRoot && oRoot != null ? oRoot : o ;

			if (o.hmode  && isNaN(parseInt(o.root.style.left  ))) o.root.style.left   = "0px";
			if (o.vmode  && isNaN(parseInt(o.root.style.top   ))) o.root.style.top    = "0px";
			if (!o.hmode && isNaN(parseInt(o.root.style.right ))) o.root.style.right  = "0px";
			if (!o.vmode && isNaN(parseInt(o.root.style.bottom))) o.root.style.bottom = "0px";

			o.minX	= typeof minX != 'undefined' ? minX : null;
			o.minY	= typeof minY != 'undefined' ? minY : null;
			o.maxX	= typeof maxX != 'undefined' ? maxX : null;
			o.maxY	= typeof maxY != 'undefined' ? maxY : null;

			o.xMapper = fXMapper ? fXMapper : null;
			o.yMapper = fYMapper ? fYMapper : null;

			o.root.onDragStart	= new Function();
			o.root.onDragEnd	= new Function();
			o.root.onDrag		= new Function();
		},

		start : function(e)
		{
			if(!(TQUtils.Drag.canDrag))return;

			var o = TQUtils.Drag.obj = this;
			e = TQUtils.Drag.fixE(e);
			var y = parseInt(o.vmode ? o.root.style.top  : o.root.style.bottom);
			var x = parseInt(o.hmode ? o.root.style.left : o.root.style.right );
			o.root.onDragStart(x, y);

			o.lastMouseX	= e.clientX;
			o.lastMouseY	= e.clientY;

			if (o.hmode) {
				if (o.minX != null)	o.minMouseX	= e.clientX - x + o.minX;
				if (o.maxX != null)	o.maxMouseX	= o.minMouseX + o.maxX - o.minX;
			} else {
				if (o.minX != null) o.maxMouseX = -o.minX + e.clientX + x;
				if (o.maxX != null) o.minMouseX = -o.maxX + e.clientX + x;
			}

			if (o.vmode) {
				if (o.minY != null)	o.minMouseY	= e.clientY - y + o.minY;
				if (o.maxY != null)	o.maxMouseY	= o.minMouseY + o.maxY - o.minY;
			} else {
				if (o.minY != null) o.maxMouseY = -o.minY + e.clientY + y;
				if (o.maxY != null) o.minMouseY = -o.maxY + e.clientY + y;
			}
			
			/*try
			{
				if(TQUtils.Drag.obj.id && TQUtils.Drag.obj.id=="tq_miniChatDiv")
				{
					o.root.style.border="1px dashed #000000";
					o.root.style.backgroundColor = "#C0C0C0";
					o.root.style.opacity="0.5";
					o.root.style.filter="Alpha(opacity=50)";
					if(!(TQUtils.IsUndefined("tq_miniChat")))
						tq_miniChat.Container.style.display="none";
				}
			}
			catch (e)
			{
			}
			*/
			if(TQUtils.tq_fixJQueryMouseMoveEvent == null)
				TQUtils.tq_fixJQueryMouseMoveEvent = document.onmousemove;
			document.onmousemove	= TQUtils.Drag.drag;
			document.onmouseup		= TQUtils.Drag.end;

			return false;
		},

		drag : function(e)
		{
			e = TQUtils.Drag.fixE(e);
			var o = TQUtils.Drag.obj;

			var ey	= e.clientY;
			var ex	= e.clientX;
			var y = parseInt(o.vmode ? o.root.style.top  : o.root.style.bottom);
			var x = parseInt(o.hmode ? o.root.style.left : o.root.style.right );
			var nx, ny;

			if (o.minX != null) ex = o.hmode ? Math.max(ex, o.minMouseX) : Math.min(ex, o.maxMouseX);
			if (o.maxX != null) ex = o.hmode ? Math.min(ex, o.maxMouseX) : Math.max(ex, o.minMouseX);
			if (o.minY != null) ey = o.vmode ? Math.max(ey, o.minMouseY) : Math.min(ey, o.maxMouseY);
			if (o.maxY != null) ey = o.vmode ? Math.min(ey, o.maxMouseY) : Math.max(ey, o.minMouseY);

			nx = x + ((ex - o.lastMouseX) * (o.hmode ? 1 : -1));
			ny = y + ((ey - o.lastMouseY) * (o.vmode ? 1 : -1));

			if (o.xMapper)		nx = o.xMapper(y);
			else if (o.yMapper)	ny = o.yMapper(x);

			TQUtils.Drag.obj.root.style[o.hmode ? "left" : "right"] = nx + "px";
			TQUtils.Drag.obj.root.style[o.vmode ? "top" : "bottom"] = ny + "px";
			TQUtils.Drag.obj.lastMouseX	= ex;
			TQUtils.Drag.obj.lastMouseY	= ey;

			TQUtils.Drag.obj.root.onDrag(nx, ny);
			return false;
		},

		end : function()
		{
			document.onmousemove = TQUtils.tq_fixJQueryMouseMoveEvent;
			document.onmouseup   = null;
			TQUtils.Drag.obj.root.onDragEnd(parseInt(TQUtils.Drag.obj.root.style[TQUtils.Drag.obj.hmode ? "left" : "right"]), 
										parseInt(TQUtils.Drag.obj.root.style[TQUtils.Drag.obj.vmode ? "top" : "bottom"]));
			/*
			try
			{
				if(TQUtils.Drag.obj.id && TQUtils.Drag.obj.id=="tq_miniChatDiv")
				{
					TQUtils.Drag.obj.root.style.border="0px none";
					TQUtils.Drag.obj.root.style.backgroundColor = "";
					TQUtils.Drag.obj.root.style.opacity="1";
					TQUtils.Drag.obj.root.style.filter="Alpha(opacity=100)";
					if(!(TQUtils.IsUndefined("tq_miniChat")))
						tq_miniChat.Container.style.display="";
				}
			}
			catch (e)
			{
			}
			*/

			TQUtils.Drag.obj = null;
		},

		fixE : function(e)
		{
			if (typeof e == 'undefined') e = window.event;
			if (typeof e.layerX == 'undefined') e.layerX = e.offsetX;
			if (typeof e.layerY == 'undefined') e.layerY = e.offsetY;
			return e;
		}
	},
	GetScrollTop : function()
	{
		var tq_posY = 0;
		var d = document;
	  if (d.documentElement && d.documentElement.scrollTop) {
		tq_posY = d.documentElement.scrollTop;
	  }
	  else if (d.body) {
		tq_posY = d.body.scrollTop;
	  }
	  else if (window.innerHeight) {
		tq_posY = window.pageYOffset;
	  }
	  if(tq_posY == "undefined")
		  tq_posY = 0;
	  return tq_posY;
	},
	GetScrollLeft : function()
	{
		var tq_posX = 0;
		var d = document;
	  if (d.documentElement && d.documentElement.scrollLeft) {
		tq_posX = d.documentElement.scrollLeft;
	  }
	  else if (d.body) {
		tq_posX = d.body.scrollLeft;
	  }
	  else if (window.innerWidth) {
		tq_posX = window.pageXOffset;
	  }
	  if(tq_posX == "undefined")
		  tq_posX = 0;
	  return tq_posX;
	},
		/*
	GetWinSize : function()
	{
		var size = new Object();
		var d = document;
		var db = d.body;
		var de = d.documentElement;
		if(TQUtils.IE)
		{
			if(de.clientHeight==0)//html
			{
				size.h=db.clientHeight;
				size.w=db.clientWidth;
			}
			else
			{
				size.h=de.clientHeight;//xhtml -2
				size.w=de.clientWidth;// -2
			}
		}
		else//if(tq_FF)
		{
			//2010-10-14 firefox和choirme有无W3c标准声明，都可以用d.documentElement.clientHeight
			size.h = de.clientHeight;
			size.w = de.clientWidth;
		}
		return size;
	},
	*/
	//2010-10-18
	GetWinSize : function()
	{
		var size = new Object();
		var d = document;
		var db = d.body;
		var de = d.documentElement;
		
		

		if(de&&de.clientHeight)
		{// IE 6 Strict Mode
			size.w = de.clientWidth;
			size.h = de.clientHeight;
		}
		else if(db)
		{// other
			size.w = db.clientWidth;
			size.h = db.clientHeight;
		}
		else if(window.innerHeight)
		{// all except IE
			size.w = window.innerWidth;
			size.h = window.innerHeight;
		}

		//2011-1-14
		var strict = document.compatMode && document.compatMode == "CSS1Compat";//xhtml
		if(!strict)
		{
			size.w = db.clientWidth;
			size.h = db.clientHeight;
		}
		return size;
	},


	GetObj : function(id)
	{
		if (this.isDOM) return document.getElementById(id);
		if (this.isIE4) return document.all[id];
		if (this.isNS4) return document.layers[id];
	},
	GetCookieVal : function(offset)
	{
	   var endstr = document.cookie.indexOf (";", offset);
	   if (endstr == -1)
		  endstr = document.cookie.length;
		  return unescape(document.cookie.substring(offset, endstr));
	},
	GetCookie : function(name)
	{
	   var arg = name + "=";
	   var alen = arg.length;
	   var clen = document.cookie.length;
	   var i = 0;
	   while (i < clen)
	   {
		  var j = i + alen;
		  if (document.cookie.substring(i, j) == arg)
		   {
			 return this.GetCookieVal (j);
		   }
		  i = document.cookie.indexOf(" ", i) + 1;
		  if (i == 0)
			 break;
	   }
	   return "";
	},
	SetCookie : function(name, value)//expires_time:　hour   if no this paras,the default vlaue is 3 years 
	{
	   var argv = TQUtils.SetCookie.arguments;
	   var argc = TQUtils.SetCookie.arguments.length;
	   var expires = new Date();
	   expires.setTime(expires.getTime() +((2 < argc) ? argv[2] : 365*24)*60*60 * 1000);
	   var expires_time = expires;
	   var path = (3 < argc) ? argv[3] : null;
	   var domain = (4 < argc) ? argv[4] : null;
	   var secure = (5 < argc) ? argv[5] : false;
	   document.cookie = name + "=" + value +
		 ((expires == null) ? "" : ("; expires=" + expires_time.toGMTString())) + ((path == null) ? "" : ("; path=" + path)) + ((domain == null) ? "" : ("; domain=" + domain)) +((secure == true) ? "; secure" : "");
	},
	SetCookie2: function(name, value) {//写根域
		var argv = TQUtils.SetCookie2.arguments;
		var argc = TQUtils.SetCookie2.arguments.length;
		var expires = new Date();
		expires.setTime(expires.getTime() + ((2 < argc) ? argv[2] : 365 * 24) * 60 * 60 * 1000);
		var expires_time = expires;
		var path = (3 < argc) ? argv[3] : null;
		//var domain = TQUtils.getRootDomain();
		var domain = (4 < argc) ? argv[4] : null;
		var secure = (5 < argc) ? argv[5] : false;
		document.cookie = name + "=" + value + ((expires == null) ? "": ("; expires=" + expires_time.toGMTString())) + ("; path=/") + ((domain == null) ? "": ("; domain=" + domain)) + ((secure == true) ? "; secure": "");
	},
	SetCookie_temp: function(name, value) {
		document.cookie = name + "=" + value + ("; path=/");
	},
	getRootDomain: function() {
		if (document.domain != null && document.domain != "") {
			try {
				return document.domain.match(/(\w+\.(?:com.cn|com|cn|net|org|cc))(?:\/|$)/)[1];
			} catch(e) {
				return null;
			}
		}
		return null;
	},
	GetTime : function()
	{
		var d=new Date();
		var mon=d.getMonth()+1;
		var nowtime=d.getFullYear()+'-'+mon+'-'+d.getDate()+' '+d.getHours()+':'+d.getMinutes()+':'+d.getSeconds();
		return nowtime;
	},
	GetTime_invite : function()//becurse the invite server is not fix the bug of "%20" to " " 
	{
		var d=new Date();
		var mon=d.getMonth()+1;
		var nowtime=d.getFullYear()+'-'+mon+'-'+d.getDate()+','+d.getHours()+':'+d.getMinutes()+':'+d.getSeconds();
		return nowtime;
	},
	GetTime_debug : function()
	{
		var d=new Date();
		var mon=d.getMonth()+1;
		var nowtime=d.getFullYear()+'-'+mon+'-'+d.getDate()+' '+d.getHours()+':'+d.getMinutes()+':'+d.getSeconds()+':'+d.getMilliseconds();
		return nowtime;
	},
	GetPageSize : function()
	{
		var d = document;
		var b = (d.compatMode!="CSS1Compat")?d.body:d.documentElement;
		var size = new Object();
		size.w = Math.max(b.scrollWidth,b.clientWidth);
		size.h = Math.max(b.scrollHeight,b.clientHeight);
		return size;
	},
	AddEvent : function(target,event,fn)
	{
		if (typeof target == 'string')
			target = TQUtils.GetObj(target);
		if (typeof target.addEventListener != "undefined") {
			target.addEventListener(event, fn, false);
		}
		else if (typeof target.attachEvent != "undefined") {
			this.AddListener(target, "on"+event, fn);
		}
		else if (typeof eval(target+".on"+event) == "function") {
			var fnOld = eval(target+".on"+event);
			eval(target+".on"+event+" = function() {fnOld();fn();}");
		}
		else {
			eval(target+".on"+event+" = fn");
		}
	},
	//*/
	AddListener : function(target, eventType, fn)
	{
		if (typeof target == 'string')
			target = TQUtils.GetObj(target);
		target.attachEvent(eventType, fn);
	},
	HeartBeat : function(obj,inteval,timer,lastPos,isHeartbeat)
	{
		if(!isHeartbeat)return;
		var tq_diffY1=TQUtils.GetScrollTop();
		var tq_diffX1=TQUtils.GetScrollLeft();
		if(tq_diffY1!=lastPos.y)
		{
			var tq_percent1=.1*(tq_diffY1-lastPos.y);
			if(tq_percent1>0)
			{
				tq_percent1=Math.ceil(tq_percent1);
			}
			else
			{
				tq_percent1=Math.floor(tq_percent1);
			}
			if(TQUtils.NS)
			{
				document.tq_float_container.top+=tq_percent1;
			}
			obj.style.top=tq_percent1+parseInt(obj.style.top)+"px";
			lastPos.y=lastPos.y+tq_percent1;
		}
		if(tq_diffX1!=lastPos.x)
		{
			var tq_percent1=.1*(tq_diffX1-lastPos.x);
			if(tq_percent1>0)
			{
				tq_percent1=Math.ceil(tq_percent1);
			}
			else
			{
				tq_percent1=Math.floor(tq_percent1);
			}
			if(TQUtils.NS)
			{
				document.tq_float_container.left+=tq_percent1;
			}
			obj.style.left=tq_percent1+parseInt(obj.style.left)+"px";
			lastPos.x=lastPos.x+tq_percent1;
		}
		timer = setTimeout(function(){TQUtils.HeartBeat(obj,inteval,timer,lastPos,isHeartbeat)},inteval);
	},

	GetTitle : function()
	{
		var tq_visit_title	= "";
		try
		{
			tq_visit_title = document.title;
			if(tq_visit_title != "undefined" && tq_visit_title != null && tq_visit_title != "" && tq_visit_title.length > 15)
				tq_visit_title = tq_visit_title.substring(0,15);
			tq_visit_title = encodeURI(tq_visit_title);
		}
		catch (e){}
		return tq_visit_title;
	},
	GetRefferTitle : function()
	{
		var reffer = this.GetReffer();
		if(reffer == "")
			return "";
		var tq_reffer_title	= this.GetCookie("tq_reffer_title");
		if(tq_reffer_title != "")
		{
			tq_reffer_title = tq_reffer_title.replace(/\^/gi,"%");
			return tq_reffer_title;
		}
		var temp = document.title;
		if(temp != "undefined" && temp != null && temp != "" && temp.length > 15)
		{
			temp = (temp.substring(0,15));
			
		}
		temp = encodeURI(temp).replace(/\%/gi,"^");
		this.SetCookie("tq_reffer_title", temp, 24*30);
		return tq_reffer_title;
	},
	GetSourceTitle : function()
	{
		var tq_source_title	= this.GetCookie("tq_source_title");
		if (tq_source_title == null || tq_source_title == "")
		{
			var reffer = this.GetReffer();
			if (reffer == "")//没有引用页时，就认为是直接输入的，把当前页的标题记下为初始来源页标题
			{
				var temp = document.title;
				if(temp != "undefined" && temp != null && temp != "" && temp.length > 15)
					temp = (temp.substring(0,15));
				temp = encodeURI(temp).replace(/\%/gi,"^");
				this.SetCookie("tq_source_title", temp, 24*30);
			}
			else//有引用页时，是无法取引用页的标题的，所以要保持一直为空
			{
				this.SetCookie("tq_source_title", "", 24*30);
			}
		}
		else
		{
			tq_source_title = tq_source_title.replace(/\^/gi,"%");
		}
		return tq_source_title;
	},
	
	GetLocalURL : function()
	{
		var local_url = window.location.href.replace(/\&/g,"*").replace(/\#/gi,"$").replace(/\?/gi,"!").replace(/\=/gi,"%3D");//.replace(/?/g,"$");
		if(local_url.length > TQKF.local_url_length)
			local_url = local_url.substring(0,TQKF.local_url_length);
		return local_url;
	},
	GetSourcePageURL: function(time) {
		var source_page_url = this.GetCookie("tq_source_page_url");
		if (source_page_url == null || source_page_url == "") {
			var reffer = this.GetReffer();
			if (reffer != "") {
				source_page_url = this.ReCreatReffer(reffer);
				//this.SetCookie("tq_source_page_url", source_page_url, time);
				this.SetCookie("tq_source_page_url", source_page_url, 24*30);
			}
		}
		return source_page_url;
	},
	//2014-12-25加针对本次会话的来访时间、来源页，初次访问页
	GetCurrentVisistTime : function()//来访时间
	{
		var current_visit_time = this.GetCookie("tq_current_visit_time");
		if (current_visit_time == null || current_visit_time == "") 
		{
			current_visit_time = new Date().getTime();
			this.SetCookie_temp("tq_current_visit_time", current_visit_time);
		}
		return current_visit_time;
	},
	GetCurrentSourcePageURL : function()//本次来源页
	{
		var current_source_page_url = this.GetCookie("tq_current_source_page_url");
		if (current_source_page_url == null || current_source_page_url == "") 
		{
			var reffer = this.GetReffer();
			if (reffer != "")
			{
				current_source_page_url = this.ReCreatReffer(reffer);
				this.SetCookie_temp("tq_current_source_page_url", current_source_page_url);
			}
		}
		return current_source_page_url;
	},
	GetCurrentFirstVisitURL : function()//本次初次访问页
	{
		var current_first_visit_url = this.GetCookie("tq_current_first_visit_url");
		if (current_first_visit_url == null || current_first_visit_url == "") 
		{
			current_first_visit_url = window.location.href.replace(/\&/g,"*").replace(/\#/gi,"$").replace(/\?/gi,"!").replace(/\=/gi,"%3D");//.replace(/?/g,"$");
			if(current_first_visit_url.length > TQKF.local_url_length)
			{
				current_first_visit_url = current_first_visit_url.substring(0,TQKF.local_url_length);
				this.SetCookie_temp("tq_current_first_visit_url", current_first_visit_url);
			}
		}
		return current_first_visit_url;
	},
	GetReffer : function()
	{
		var tq_refTemp = ''; 
		if (document.referrer.length > 0)
		{ 
		  tq_refTemp = document.referrer; 
		} 
		try
		{ 
			if (tq_refTemp.length == 0 && opener && opener.location.href.length > 0)
			{ 
				tq_refTemp = opener.location.href; 
			} 

		}
		catch(e){}
		return tq_refTemp;
		//return "http://www.googlse.cn/search?hl=zh-CN&source=hp&w=%E6%B4%BD%E8%B0%88%E9%80%9A&aq=0&oq=%E6%B4%BD%E8%B0";
	},
	GetPara : function (url,name)   
	{   
		if(url==null || url=="")
			return "";
		var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");   
		var r = url.substr(url.indexOf("\?")+1).match(reg);   
		if (r!=null)
		{
			return (r[2]);
		}
		return "";
	},
	//解决URL过长的问题，将url中的关键词提出后，其它的过滤掉
	/*
	ReCreatReffer: function (url,keyparas)
	{
		if(url == null || url.length == 0)
			return "";
		for(var i = 0; i < keyparas.length; i++)
		{
			var keyword = this.GetPara(url,keyparas[i]);
			if(keyword != "")
			{
				var domain =  url.substring(0,url.indexOf("?"));
				
				if(domain.indexOf("google") != -1 || domain.indexOf("bing") != -1)//google、必应的关键词是用UTF8编码的,要用decodeURI解码
				{
					//2011-8-17关键词乱码问题源于此？试一下
					
					//if(this.FF)
					//{
						
						//keyword = encodeURI(encodeURI(keyword));//因为不两次encodeURI，vip后台会读出乱码
					//}
					//else
					
					{
						try
						{
							keyword = decodeURI(keyword);
						}
						catch (e)
						{
						}
					}
				}
				return domain+"?"+keyparas[i]+"="+keyword.replace(/\%/g,"^");//2011-8-17将%替换为^,传给会话页时再还原
			}
		}
		if(url.length > 390)
			url = url.substring(0,300);
		return url.replace(/\&/g,"*").replace(/\%/g,"^");
	},*/
	ReCreatReffer: function(url) {
		if (url == null || url.length == 0) return "";
		var domain = url.substring(0, url.indexOf("?"));
		for (var i = 0; i < TQKF.filterURLs.length; i++) {
			var isSearchEngine = false;
			for (var j = 0; j < TQKF.filterURLs[i].domain.length; j++) {
				if (domain.indexOf(TQKF.filterURLs[i].domain[j]) != -1) {
					isSearchEngine = true
				}
			}
			if (isSearchEngine) {
				var keyword = this.GetPara(url, TQKF.filterURLs[i].keyPara);
				if (keyword != "") {
					return domain + "!" + TQKF.filterURLs[i].keyPara + "^3D" + keyword.replace(/\%/g, "^")
				}
			}
		}
		if (url.length > TQKF.reffer_url_length) url = url.substring(0, TQKF.reffer_url_length);
		return url.replace(/\?/g, "!").replace(/\&/g, "*").replace(/\%/g, "^").replace(/\#/gi,"^23").replace(/\=/gi,"^3D");
	},
	SetConfigValue : function(prefix,config)
	{
		for(var v in config)
		{
			if(eval("typeof("+prefix+v+")!='undefined'"))
			{
				//alert(prefix+v+":"+(eval(prefix+v) != ""));
				if(eval(prefix+v) != "")
					config[v] = eval(prefix+v);
			}
		}
	},
	//2010-6-22
	SetValue : function(from,to)
	{
		for(var prop in from)
		{
			if(typeof(from[prop]) == "function")
					continue;
			else if(from[prop] != null && from[prop] != "null" && !(from[prop] === ""))
			{
				if(typeof(from[prop]) == "object")
				{
					if(!to[prop])
						to[prop]={};
					this.SetValue(from[prop],to[prop]);
				}
				else
					to[prop] = from[prop];
			}
			if(from[prop] === "" && !to[prop])//如果to没有prop属性， 则尽管from[prop]="",也要给to加上prop属性
				to[prop] = from[prop];
		}
	},
	FillInnertip : function(str)
	{
		return str.replace(/&quot;/g, '"').replace(/&#039;/g, "'").replace(/&lt;/g, '<').replace(/&gt;/g, '>').replace(/&amp;/g, "&");
	},
	IsFlash : function(url)
	{
		return url.indexOf(".swf") != -1 || url.indexOf(".flv") != -1
	},
	Disp : function(obj)
	{
		if (typeof obj == 'string')
			obj = TQUtils.GetObj(obj);
        //obj == null || (obj.style.display = 'block');
		 obj == null || (obj.style.visibility="visible");
	},
	Hide : function(obj)
	{
		if (typeof obj == 'string')
			obj = TQUtils.GetObj(obj);
       // obj == null || (obj.style.display = 'none');
		obj == null || (obj.style.visibility="hidden");

	},
	setDefaultValue : function(def,value)
	{
		if(value == null || value == "")
			return def;
		else
			return value;
	},
	FixFlash : function()
	{
		if(TQKF.isFlashFixed == true)
			return;
		TQKF.isFlashFixed = true;
		var d=document;
		var fs = d.getElementsByTagName('object'),
        ems = d.getElementsByTagName('embed');
		if(TQUtils.FF)
		{
			for (var i = 0; i < ems.length; i++)
			{
				ems[i].setAttribute("wmode", "transparent");
				ems[i].setAttribute("src", ems[i].getAttribute("src"));
			}
		}
		else
		{
			for (var i = 0; i < fs.length; i++)
			{
				var newFlash = document.createElement('object');
				newFlash.setAttribute("codeBase",fs[i].getAttribute("codeBase"));
				newFlash.setAttribute("classid",fs[i].getAttribute("classid"));
				newFlash.setAttribute("width",fs[i].getAttribute("width"));
				newFlash.setAttribute("height",fs[i].getAttribute("height"));
			
				for(var j=0;j<fs[i].childNodes.length;j++)
				{
					newFlash.appendChild(fs[i].childNodes[j]);
				}
				var wc = document.createElement('param');
				wc.name = 'wmode';
				wc.value = 'transparent';
				newFlash.appendChild(wc);

				var h = newFlash.outerHTML;
				//p.removeChild(fs[i]);
				fs[i].outerHTML = h;
				//p.appendChild(fs[i]);
			}
		}
	},
	isInCode: function(status, code) {
		var codes = code.split("|");
		for (var i = 0; i < codes.length; i++) {
			if (codes[i] == status) return true;
		}
		return false;
	}
};

//2009-11-24
TQUtils.ieVersion			= /msie (\d+)/.exec(TQUtils.browserType);
TQUtils.higherThanIE6		= TQUtils.ieVersion && parseInt(TQUtils.ieVersion[1]) > 6;
try
{
	TQUtils.onQuirkMode			= document.compatMode && document.compatMode.indexOf('Back') == 0;//html
	TQUtils.strict = document.compatMode && document.compatMode == "CSS1Compat";//xhtml
}
catch (e)
{
	//TQUtils.onQuirkMode = false;
	TQUtils.strict = false;
}

//2010-6-9
TQUtils.isSupportFixedPos	= (window.addEventListener || TQUtils.higherThanIE6 && (!TQUtils.onQuirkMode)) ? true:false;
//TQUtils.isSupportFixedPos	= window.addEventListener || TQUtils.higherThanIE6 && TQUtils.strict;
//TQUtils.isSupportFixedPos = TQUtils.FF || TQUtils.Chrome;
if(TQUtils.ieVersion && !(TQUtils.higherThanIE6)) 
{
	try
	{
		document.execCommand("BackgroundImageCache", false, true);
	}
	catch (e)
	{
	}
}

var tq_debugFrame = null;
var tq_debug = 3;
var tq_info  = 2;
var tq_error = 1;

try
{
	var tempRef = window.location.href;
	tempRef = TQUtils.GetPara(tempRef,"tqdebug");
	if(tempRef != "")
		TQKF.userDefined.debug = tempRef;
}
catch (e)
{
}
/**
* Example:DEBUG("this is a debug function wirte by tongsy",error);
*/
function TQ_DEBUG(info,level)
{
	/*
	Error对象属性
	description: 错误描述 (仅IE可用). 
	fileName: 出错的文件名 (仅Mozilla可用). 
	lineNumber: 出错的行数 (仅Mozilla可用). 
	message: 错误信息 (在IE下同description) 
	name: 错误类型. 
	number: 错误代码 (仅IE可用). 
	stack: 像Java中的Stack Trace一样的错误堆栈信息 (仅Mozilla可用). 
	*/
	try
	{
		if(level <= TQKF.userDefined.debug)
		{
			if(tq_debugFrame==null)
			{
				tq_debugFrame=window.open("about:blank","tq_debugFrame","width=600,height=400,location=no,resizable=1,scrollbars=1,status=no,toolbar=no,menu=no,top=100,left=200");
				if(TQUtils.IE)
				{
					tq_debugFrame.document.body.style.backgroundColor="#EBE9ED";
					tq_debugFrame.document.title="debug info";
					tq_debugFrame.document.body.innerHTML += '<span style="font-size:14px;color:#00A600"><b>debug info:</b></span>';
					tq_debugFrame.document.body.innerHTML += '<div id=debug_div style="word-wrap:break-word;word-break:break-all;font-size:12px;width:100%;	border: 1px solid;	border-color: threedshadow threedhighlight threedhighlight threedshadow;display: block;background-color:#000000;"></div>';
				}
			}
			if(level==1)//error
				color = "red";
			else if(level==2)//warning
				color = "yellow";
			else 
				color = "white";
			var functionText="";
			if(TQUtils.IE)
			{
				//if (DEBUG.caller)
				//	functionText= DEBUG.caller.toString();
				tq_debugFrame.document.getElementById("debug_div").innerHTML += ("<span style='color:white'><b>["+TQUtils.GetTime_debug()+"]&nbsp;&nbsp;---->></b>"+functionText+"</span><span style='color:"+color+"'>"+info+"</span><br>");
			}
			else
			{
				tq_debugFrame.document.body.innerHTML += "<div style='word-wrap:break-word;word-break:break-all;font-size:12px;width:100%;	border: 0px;background-color:#000000;;color:"+color+"'>"+("<span style='color:white'><b>["+TQUtils.GetTime_debug()+"]&nbsp;&nbsp;---->></b>"+functionText+"</span><span style='color:"+color+"'>"+info+"</span><br>")+"</div>";
			}
			tq_debugFrame.scroll(0, 90000);
		}
	}
	catch (e)
	{
	}
}



TQKF.local_url		= TQUtils.GetLocalURL();
TQKF.visit_title	= TQUtils.GetTitle();

TQKF.reffer_url		= TQUtils.ReCreatReffer(TQUtils.GetReffer());
//TQKF.reffer_title	= TQUtils.GetRefferTitle();

TQKF.source_page_url = TQUtils.GetSourcePageURL(TQKF.source_page_life_time * (1 / 60));
//TQKF.source_title	= TQUtils.GetSourceTitle();

TQKF.current_visit_time	= TQUtils.GetCurrentVisistTime();//本次访问网站的来访时间
TQKF.current_first_url	= TQUtils.GetCurrentFirstVisitURL();//本次访问网站的首个页面
TQKF.current_source_url	= TQUtils.GetCurrentSourcePageURL();//本次访问网站的来源页面

//兼容老版本
TQUtils.SetValueIfUndefinedOrEmpty("tq_version","");
if(tq_version == "")
{
	TQUtils.SetValueIfUndefinedOrEmpty("tq_is_fix_flash","1");
	TQUtils.SetValueIfUndefinedOrEmpty("tq_float_type","1");
	TQUtils.SetValueIfUndefinedOrEmpty("tq_float_style","1");
	TQUtils.SetValueIfUndefinedOrEmpty("tq_invit_style","1");
	TQUtils.SetValueIfUndefinedOrEmpty("tq_infocard_url","");
	TQUtils.SetValueIfUndefinedOrEmpty("tq_float_layout_cfg",'');
	TQUtils.SetValueIfUndefinedOrEmpty("tq_float_html","");
	TQUtils.SetValueIfUndefinedOrEmpty("tq_is_fold_term","0");
	TQUtils.SetValueIfUndefinedOrEmpty("tq_invit_sound","");
	TQUtils.SetValueIfUndefinedOrEmpty("tq_invit_layout_cfg",'');
	TQUtils.SetValueIfUndefinedOrEmpty("tq_invit_auto_hide_delay","0");
	TQUtils.SetValueIfUndefinedOrEmpty("tq_invit_is_hide_float","0");
	TQUtils.SetValueIfUndefinedOrEmpty("tq_invit_response_uins","");
	TQUtils.SetValueIfUndefinedOrEmpty("tq_kefuimg_cfg",'');
}
if(tq_is_fix_flash == 1)
{
	try
	{
		TQUtils.FixFlash();
	}
	catch (e)
	{
	}
	TQUtils.AddEvent(window,"load",TQUtils.FixFlash);
}
/*if(tq_language=="100")
{
	TQKF.ltype_str	= "_en";
	TQKF.words		= TQKF.words_en;
}
else
{
	TQKF.words = TQKF.words_zh;
}*/

if(tq_language=="100")
	tq_language = 2;
if(tq_language>1)
	//TQKF.ltype_str	= "_"+TQKF.languageList[tq_language+""];//2016-12-18去掉状态图标的多语言分类
	TQKF.ltype_str	= "_en";

TQKF.words = TQKF["words_"+TQKF.languageList[tq_language+""]];

TQUtils.SetValueIfUndefinedOrEmpty("tq_if_tryout",0);//2010-2-6改为默认为免费用户
TQUtils.SetValueIfUndefined("tq_iscallback","1");

TQUtils.SetValueIfUndefined("TQKF.chattype","");//2013-11-5这个参数是干什么的？
TQUtils.SetValueIfUndefined("tq_isnoshowuser","0");
TQUtils.SetValueIfUndefined("tq_isFullScreenLeavmsg",false);
TQUtils.SetValueIfUndefined("tq_agentid","0");
TQUtils.SetValueIfUndefined("tq_siteid","");

//我们给第三方留一个整合接口，方法为：第三方在其欲整合的页面中，在嵌入的TQ代码之前加上如下一句代码：<script>var tq_clientid="第三方的会员ID";</script>第三方的会员ID可以是数字或字符串，由第三方自己动态生成。
TQUtils.SetValueIfUndefined("tq_clientid","");
TQUtils.SetValueIfUndefined("tq_clientname","");

//2013-11-5加网页媒体统计参数的提取及传递
TQKF.tq_media_param_value = TQUtils.GetPara(window.location.href,TQKF.tq_media_param_name);

//免费版的要屏蔽一些功能
if(tq_if_tryout == 0)
{

	if(tq_version =="" || parseInt(tq_version) < parseInt(TQKF.version))//以前的免费版
	{
		if(tq_invit_style == 1)
			tq_displaytype			= "0";//风格：中间形式：0免费版，1没有稍后再说，2有稍后再说　　　　　右下角：0免费版，1　VIP
		else
		{
			tq_invit_style = 1;
			tq_displaytype = 100;
		}
		tq_invit_color			= "1";//以前免费版只有一种颜色
	}
	TQUtils.SetValueIfUndefinedOrEmpty("tq_invit_style",1);
	
	//tq_invit_color			= "1";
	tq_language_type		= "";
	//tq_iscallback			= 1;
	TQUtils.SetValueIfUndefinedOrEmpty("tq_type",1);//以前的免费版无此变更
	TQKF.invite_server_url	= TQKF.feefree_invite_server_url;
	TQKF.webchat_url2		= TQKF.feefree_webchat_url2;
	if(typeof(tq_webchat_url) != "undefined")
	{
		TQKF.webchat_url2		= tq_webchat_url+"/sendmain.jsp";
	}
	TQKF.leavemsg_url		= TQKF.feefree_leavemsg_url;//不走pageinfo.jsp就无法实现自定义留言页url的功能！！
	tq_acd					= 0;
	tq_is_anti_bad_click	= 0;
	if(tq_type == 2 && typeof(tq_isnoshowuser)!="undefined" && tq_isnoshowuser == "")//免费版的客服图片形式，默认显示客服列表
		tq_isnoshowuser = "0";
	TQKF.open_win_w			= 596;//596;
	TQKF.open_win_h			= 438;//438;
}

if(typeof(tq_webscreen_url) != "undefined")
{
	TQKF.invite_server_url = tq_webscreen_url;
}
if(typeof(tq_webchat_url) != "undefined")
{
	TQKF.webchat_url = tq_webchat_url;
	TQKF.webchat_url2 = tq_webchat_url+"/pageinfo.jsp";
	TQKF.pageinfo_url = tq_webchat_url+"/pageinfo.jsp";
	TQKF.leavemsg_url = tq_webchat_url+"/pageinfo.jsp";
	TQKF.hashChatURL = tq_webchat_url;
}
//代理
if(typeof(tq_chat_url) != "undefined" && tq_chat_url != "")
{
	TQKF.webchat_url = tq_chat_url;
	TQKF.webchat_url2 = tq_chat_url+"/pageinfo.jsp";
	TQKF.pageinfo_url = tq_chat_url+"/pageinfo.jsp";
	TQKF.leavemsg_url = tq_chat_url+"/pageinfo.jsp";
}

//2012-7-26中企动力需求，要从嵌入代码中自定义留言页面
if(typeof(tq_leavemsg_url) != "undefined" && tq_leavemsg_url != "")
{
	TQKF.leavemsg_url = tq_leavemsg_url;
}
//2011-6-3加后台设置
if(typeof(tq_is_panel_float)!="undefined" && tq_is_panel_float != "")
	 TQKF.userDefined.isfloat = tq_is_panel_float;
//若有自定义，以自定义为准
if(!TQUtils.IsUndefined("tqUserDefined"))
	TQUtils.SetValue(tqUserDefined,TQKF.userDefined);



self.onerror = function (){return true;};
window.onerror = function (){return true;};
TQKF.setWindowStatus();
//解决代码嵌入在body之前在IE下有错的问题
try
{
	var tqhasbody = document.body.nodeType;
}
catch (e)
{
	TQ_DEBUG("get document.body.nodeType error try creat body tag",3);
	document.writeln("<body><\/body>");
}
document.writeln('<scr'+'ipt id=TQGetrequestUser_JS>\<\/scr'+'ipt\>');//用于发心跳包
document.write("<scr"+"ipt id=TQGetIsNewMsg_JS>\<\/sc"+"ript>");//用于迷你会话层

document.writeln('<scr'+'ipt src="'+TQKF.userDefined.asJS+'">\<\/scr'+'ipt\>');//此处不能用loadJS
if(tq_is_anti_bad_click=="1")
	document.writeln('<scr'+'ipt src="'+TQKF.userDefined.antibadclickJS+'">\<\/scr'+'ipt\>');

/*
document.writeln('<scr'+'ipt src="'+TQKF.js_url+'as.js">\<\/scr'+'ipt\>');//此处不能用loadJS
if(tq_is_anti_bad_click=="1")
	document.writeln('<scr'+'ipt src="'+TQKF.js_url+'antibadclick.js">\<\/scr'+'ipt\>');
*/
if(tq_type == "1" || tq_type == "4")
{
	TQUtils.LoadCSS(TQKF.float_image_url+'t'+tq_float_type+'/s'+tq_float_style+'/style.css');
}

/*
if(tq_type == "4")
{
	TQUtils.LoadCSS(TQKF.invite_image_url+'tracqfloat.css');
}
*/
if(TQKF.isInviter == 1)//2011-6-2修正当仅用于流量统计时，会出现tq_invit_style="",而导致加载的css不存在的问题
{
	if(tq_invit_style == "")
		tq_invit_style = "1";
	if(tq_version =="" || parseInt(tq_version) < parseInt(TQKF.version) && tq_invit_style == 2)
		TQUtils.LoadCSS(TQKF.invite_image_url + "t1/style.css");
	else
		TQUtils.LoadCSS(TQKF.invite_image_url + "t" + tq_invit_style+"/style.css");
}



///*
//2010-8-23加获取QQ在线状态
var online=new Array();
var tq_QQuin = [];
var tq_isGetQQOnlineStatus = false;
if(tq_type == "1" && typeof(tq_member_uins) != "undefined")
{
	eval("tq_member_uins_temp="+tq_member_uins);
	for(var i=0; i<tq_member_uins_temp.length; i++)
	{
		var tq_t = tq_member_uins_temp[i];
		for(var m=0;m<tq_t.m.length;m++)
		{
			if(tq_t.m[m].t == "qq" && tq_t.m[m].s >100 && tq_t.m[m].s < 200)
			{
				tq_QQuin.push(tq_t.m[m].id);
				tq_isGetQQOnlineStatus = true;
			}
		}
	}
}
function tq_getQQUinIndex(uin)
{
	for(var w=0;w<tq_QQuin.length;w++)
	{
		if(tq_QQuin[w]==uin)
		{
			return w;
		}
	}
	return -1;
}
if(tq_isGetQQOnlineStatus)
{	
	TQUtils.LoadJS('http://webpresence.qq.com/getonline?Type=1&'+tq_QQuin.join(":")+':',TQKF.userDefined.defer);
	//document.write('<sc'+'ript language="javascript" src="http://webpresence.qq.com/getonline?Type=1&'+tq_QQuin.join(":")+':"></scr'+'ipt');
}


//*/


if(TQUtils.IE)//IE他奶的纯粹是王八蛋!!!
{
	if(document.readyState=="complete")
	{
		TQ_DEBUG("IE, all DOM loaded,begin to load TQJS",3);
		TQKF.loadRequiredJS();
	}
	else
	{
		TQ_DEBUG("IE, DOM have not loaded,load TQJS later",3);
		//谁快就执行谁
		if(TQKF.userDefined.forceLoadRequiredJS > 0)//有问题的网站，弹不出飘浮框，就在嵌入代码前加一句<script>var tqUserDefined = {forceLoadRequiredJS:10}//单位秒</script>
			setTimeout(TQKF.loadRequiredJS,parseInt(TQKF.userDefined.forceLoadRequiredJS)*1000);//还是可能会导致“internet explorer 无法打开站点，已终止操作”
		TQUtils.AddEvent(window,"load",TQKF.loadRequiredJS);
		//当网页中有打不开的iframe时，下面的代码就执行不了了,onload事件也不会触发,就会导致飘浮框邮不来
		document.onreadystatechange=function()
			{
				if(document.readyState=="complete")
				{
					TQ_DEBUG("IE,document.readyState==complete,load TQJS now",3);
					TQKF.loadRequiredJS();
				}
			}
	}
}
else
	TQKF.loadRequiredJS();


//2010-1-12
//2010-10-14修正单独免费电话和VIP代码同时使用时，引用两次webcall.js的问题
//2010-10-14免费版的询问框已经不用此种免费电话了
/*
if(TQKF.isInviter > 0 && typeof(tq_if_tryout)!="undefined" && tq_if_tryout !=1 && tq_iscallback=="1" && tq_language!=100 && typeof(_showcallPane)=="undefined")
{
	document.write('<script language=JavaScript src="'+TQKF.js_url+'webcall.js">\<\/scr'+'ipt>');
}
*/

//2010-6-9
//加此句又会和部分网站冲突，还是向push妥协吧！不用了
//Array.prototype.push=function(){for(var i=0;i<arguments.length;i++)this[this.length]=arguments[i];return this.length;};

//2010-6-11坚决不妥协！只有当push方法被修改时，才试图修正回来
try
{
	var tqnooooouse =[];
	tqnooooouse.push(1,2,3);
	if(tqnooooouse.join("") != "123")//1
		Array.prototype.push=function(){for(var i=0;i<arguments.length;i++)this[this.length]=arguments[i];return this.length;};
}
catch (e)
{
}

//2011-5-9加firebug-lite功能
if(TQUtils.GetPara(window.location.href,"tq_debug") == "1")
{
	document.write("<a href=\"javascript:(function(F,i,r,e,b,u,g,L,I,T,E){if(F.getElementById(b))return;E=F[i+'NS']&amp;&amp;F.documentElement.namespaceURI;E=E?F[i+'NS'](E,'script'):F[i]('script');E[r]('id',b);E[r]('src',I+g+T);E[r](b,u);(F[e]('head')[0]||F[e]('body')[0]).appendChild(E);E=new%20Image;E[r]('src',I+L);})(document,'createElement','setAttribute','getElementsByTagName','FirebugLite','4','firebug-lite.js','releases/lite/latest/skin/xp/sprite.png','https://getfirebug.com/','#startOpened');\">Firebug Lite</a>");
}

//2014-4-29firefox等浏览器下加contains方法
if(typeof(TQKF.userDefined.floatMaxStatusCloseMode)!="undefined" && TQKF.userDefined.floatMaxStatusCloseMode=="0")
{
	 if(typeof(HTMLElement)!="undefined")
	 {
		 HTMLElement.prototype.contains=function(obj)
		 {
			 while(obj!=null && typeof(obj.tagName)!="undefined")
			 {
				 if(obj == this)
					return true;
				obj = obj.parentNode;
			 }
			 return false;
		 }
	 }
}

/*
//onDomReady
function onDomReady(f){
	onDomReady.bindReady();
	if(onDomReady.isReady){
		f();
	}else{
		onDomReady.readyList.push(f);
	}
}
onDomReady.isReady = false;
onDomReady.readyBound = false;
onDomReady.readyList = new Array();
onDomReady.userAgent = navigator.userAgent.toLowerCase();
onDomReady.browser = {
	version: (onDomReady.userAgent.match(/.+(?:rv|it|ra|ie)[/: ]([d.]+)/) || [])[1],
	safari: /webkit/.test(onDomReady.userAgent),
	opera: /opera/.test(onDomReady.userAgent),
	msie: /msie/.test(onDomReady.userAgent) && !/opera/.test(onDomReady.userAgent),
	mozilla: /mozilla/.test(onDomReady.userAgent) && !/(compatible|webkit)/.test(onDomReady.userAgent)
};

onDomReady.execute = function(){
	if(onDomReady.isReady) return;
	var len = onDomReady.readyList.length;
	for(var n = 0; n < len; n++) onDomReady.readyList[n]();
	onDomReady.readyList = null;
	if(onDomReady.browser.mozilla || onDomReady.browser.opera) document.removeEventListener("DOMContentLoaded", onDomReady.execute, false);
	onDomReady.isReady = true;
}

onDomReady.bindReady = function(){
	if(onDomReady.readyBound) return;
	onDomReady.readyBound = true;
	if(onDomReady.browser.mozilla || onDomReady.browser.opera){
		document.addEventListener("DOMContentLoaded", onDomReady.execute, false);
	}else if(onDomReady.browser.msie){
		document.write("<scr" + "ipt id=__ie_init defer=true " + "src=//:></script>");
		var script = document.getElementById("__ie_init");
		if(script){
			script.onreadystatechange = function(){
				if(this.readyState != "complete") return;
				onDomReady.execute();
			};
		}
		script = null;
	}else if(onDomReady.browser.safari){ 
		onDomReady.safariTimer = setInterval(function(){
			if(document.readyState == "loaded" || document.readyState == "complete"){
				clearInterval(onDomReady.safariTimer);
				onDomReady.safariTimer = null;
				onDomReady.execute();
			}
		}, 10);
	}
	if(typeof window.addEventListener == "function"){
		window.addEventListener("load", onDomReady.execute, false);
	}else if(typeof window.attacheEvent == "function"){
		window.attacheEvent("onload", onDomReady.execute);
	}
}

function init()
{
	alert("init")
}
//调用方法：onDomReady(init);
*/
/*
问题，页面没解析完时，执行appendDOM会导致“internet explorer 无法打开站点，已终止操作”
解决方法：1、先在调用JS的地方加入判断：if(document.readyState=="complete"), 若为否，则setTimeout若干秒之后重新作这个操作。但是，此属性只对ie，opeara有效
2、在script中使用defer属性。意在页面加载完毕后再执行脚本,这样可以避免找不到对象的问题。defer不会考虑外部文件是否全部下载完，只会判当前页面是否全部加载完成。只是，有defer标签的代码块里不能写document.write方法，最终在引入脚本处改为：<script type="text/javascript" language="javascript" defer="defer" src="../JS/common.js"></script>
*/

//Math.uuid=(function(){var $="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split("");return function(_,G){var C=$,F=[],D=Math.random;G=G||C.length;if(_){for(var B=0;B<_;B++)F[B]=C[0|D()*G]}else{var A=0,E;F[8]=F[13]=F[18]=F[23]="-";F[14]="4";for(B=0;B<36;B++)if(!F[B]){E=0|D()*16;F[B]=C[(B==19)?(E&3)|8:E&15]}}return F.join("")}})();
//var randomUUID=Math.uuid;